Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.2 KB

File metadata and controls

53 lines (36 loc) · 1.2 KB

Taints and Tolerations

In this training course, we will use taints and tolerations to influence scheduling.

Navigate to the folder 22_taints-and-tolerations from CLI, before you get started.

Taint the node

kubectl taint nodes <NODE-NAME> foo=bar:NoSchedule

Verify the taint on the node

kubectl get nodes -o=custom-columns='NODE_NAME:metadata.name,TAINTS:spec.taints[*]'

Inspect deployment.yaml definition file and create the deployment

cat deployment.yaml
kubectl create -f deployment.yaml

Verify all pods not running on the tainted node

kubectl get pods -o=custom-columns='POD_NAME:metadata.name,NODE_NAME:spec.nodeName'

Inspect pod.yaml definition file and create the pod

cat pod.yaml
kubectl create -f pod.yaml

Verify that the pod is running on the tainted node

kubectl get pods -o=custom-columns='POD_NAME:metadata.name,NODE_NAME:spec.nodeName'

Cleanup

kubectl delete pod my-pod
kubectl delete deployment my-deployment
kubectl taint nodes <NODE-NAME> foo=bar:NoSchedule-

Jump to Home | Previous Training | Next Training