node-taint.yml 666 B

12345678910111213141516171819202122
  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: pod-taint
  5. spec:
  6. containers:
  7. - name: nginx
  8. image: nginx
  9. ports:
  10. - containerPort: 80
  11. tolerations:
  12. - key: "aa"
  13. operator: "Equal"
  14. value: "bb"
  15. effect: "NoSchedule"
  16. # 意思是,如果该pod没有这是容忍该污点,那么就不在这个node上调度
  17. # NoSchedule和NoExecute区别
  18. # NoSchedule不调度,如果是在调度后设置的污点,并且Pod没有容忍该污点,也能继续执行
  19. # NoExecute不执行,如果是在调度后设置的污点,并且Pod没有容忍该污点,则会被驱逐
  20. # 可以设置驱逐时间tolerationSeconds: 3600