Skip to content

Latest commit

 

History

History
27 lines (25 loc) · 686 Bytes

04 - taints-tolerations.md

File metadata and controls

27 lines (25 loc) · 686 Bytes

Taints and Tolerations

  • Example:

    • kubectl taint nodes worker01 disk=ssh:NoSchedule
      • NoSchedule will not be schedule on it
    • kubectl taint nodes worker01 disk=ssh:PreferNoSchedule
      • PreferNoSchedule will try to avoid schedule on it
    • kubectl taint nodes worker01 disk=ssh:NoExecute
      • NoExecute will evict all the pods that don't have the taint
  • Remove taint:

    • kubectl taint nodes worker01 disk=ssh:NoExecute-
  • POD:

    apiVersion: v1
    kind: Pod
    metadata:
      name: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
      tolerations:
      - key: "example-key"
        operator: "Exists"
        effect: "NoSchedule"