51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

k8s 污点之NoExecute参考案例

k8s 污点之NoExecute参考案例

1.创建资源清单

apiVersion: apps/v1
kind: Deployment
metadata:
  name: deploy-taint
spec:
  replicas: 10
  selector:
    matchExpressions:
    - key: apps
      values: 
      - "v1"
      - "v2"
      operator: NotIn
  template:
    metadata:
      labels:
        school: baimei
    spec:
      # 如果测试效果不明显,可以使用nodeName来测试
      #nodeName: worker232
      containers:
      - name: v1
        image: harbor.baimei.com/baimei-apps/apps:v1

2.打污点

kubectl taint node worker232 school=baimei:NoExecute

kubectl describe nodes | grep Taints -A 2

3.观察Pod的调度情况

 kubectl get pods -o wide
赞(4)
未经允许不得转载:工具盒子 » k8s 污点之NoExecute参考案例