19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9 ■ Scheduling Pods on Nodes

Figure 9-27. The pod is scheduled on the first node it finds with the matching label

Next, we shall demonstrate that if a node with a matching label is not found, the pod is not scheduled at

all. We need to delete all the labels, as we shall be using the same definition files for pods and with the same

nodeSelector field settings. Delete the label added previously to each of the nodes:

kubectl label nodes ip-10-0-0-151.ec2.internal kubernetes.io/image-name

kubectl label nodes ip-10-0-0-152.ec2.internal kubernetes.io/image-name

kubectl label nodes ip-10-0-0-153.ec2.internal kubernetes.io/image-name

The node labels are removed, even though the command output indicates that the node was labeled, as

shown in Figure 9-28. Removing a node label is also considered labeling a node.

Figure 9-28. Removing node labels

List the nodes, including labels, and the node labels should not include the labels added previously, as

shown in Figure 9-29.

218

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!