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

The optional scheduler.alpha.kubernetes.io/name annotation on a pod can be used to specify the

scheduler to use. Next, we shall demonstrate the use of the annotation. Create a pod definition file named

pod1.yaml:

sudo pod1.yaml

In the first example, we shall not specify the scheduler.alpha.kubernetes.io/name annotation. Copy

the following listing to the pod1.yaml.

---

apiVersion: v1

kind: Pod

metadata:

name: pod-without-annotation

labels:

name: multischeduler

spec:

containers:

-

image: "gcr.io/google_containers/pause:2.0"

name: pod-without-annotation

The pod1.yaml file is shown in a vi editor in Figure 9-14.

Figure 9-14. Pod definition without scheduler annotation

Create a pod using the definition file:

./kubectl create -f pod1.yaml

Subsequently, list the pods:

./kubectl get pods -o wide

The pod-without-annotation is created and listed as shown in Figure 9-15. The default scheduler is

used to schedule the pod using the default scheduling policy.

210

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

Saved successfully!

Ooh no, something went wrong!