19.06.2021 Views

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9 ■ Scheduling Pods on Nodes

Figure 9-53. Pod definition file podNodeAffinity.yaml

Create the with-labels pod using the pod definition file. List the cluster-wide pods. The with-labels

pod is scheduled on the node with the label kubernetes.io/image-name: nginx, as shown in Figure 9-54.

The scheduling policy does not just constitute the priority functions, and the node affinity is not the only

priority function; and with node affinity being soft, the pod could have been allocated to a random node or

the allocation could be based on the result of the priority function’s score calculation.

Figure 9-54. Scheduing pod using node affinity preferredDuringSchedulingIgnoredDuringExecution

Add the another-annotation-key: another-annotation-value as kubernetes.io/image-name:

hello-world as shown in Figure 9-55.

232

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

Saved successfully!

Ooh no, something went wrong!