Skip to content

Files

20_scheduling-affinity

Node Affinities

In this training course, we will show how the Kubernetes Scheduler tries to keep things away from each other.

Navigate to the lab folder:

cd /workspaces/kubernetes-fundamentals/20_scheduling-affinity

Inspect water-pod.yaml definition file and create the water-pod

cat water-pod.yaml
kubectl create -f water-pod.yaml

Inspect fire-deployment.yaml definition file and create the fire-deployment

cat fire-deployment.yaml
kubectl create -f fire-deployment.yaml

Verify that the pods location

Pods fire must not be on the same node as the pod water.

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

Cleanup

kubectl delete pod water
kubectl delete deployment fire