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

Then list the pods; the pods should not be in Pending status, having completed or running as shown in

Figure 9-33. The pods are scheduled when suitable nodes are found.

Figure 9-33. Previously Pendingpods are scheduled when nodes with matching labels are found

If node labels are modified at runtime, for example if a label from a node is removed, a Running pod

does not have its status changed to Pending and continues to run if running even though the node on which

the pod is running does not have a matching label. As an example, remove the labels from the node on

which the nginx pod is running, and the pod continues to run as shown in Figure 9-34.

Figure 9-34. A running pod continues to run on a node even though matching labels from node are removed

Setting Node Affinity

Starting with version 1.2, Kubernetes offers an alpha version of a new mechanism for selecting nodes, called

node affinity. The alpha version of node affinity is based on labels, but support for other types of node

affinity is planned to be added, such as scheduling pods on a node based on which other pods are running

on the node. Currently, two types of node affinity are supported as discussed in Table 9-3.

220

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

Saved successfully!

Ooh no, something went wrong!