0
0
Kubernetesdevops~10 mins

Why scheduling controls Pod placement in Kubernetes - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the node selector for a Pod.

Kubernetes
spec:
  nodeSelector:
    disktype: [1]
Drag options to blanks, or click blank then click option'
Aslow
Bssd
Clarge
Dfast
Attempts:
3 left
💡 Hint
Common Mistakes
Using a value that does not match any node label.
Confusing nodeSelector with resource requests.
2fill in blank
medium

Complete the command to view the scheduler logs.

Kubernetes
kubectl logs -n kube-system [1]
Drag options to blanks, or click blank then click option'
Akube-apiserver
Bkube-controller-manager
Cetcd
Dkube-scheduler
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to get logs from the API server instead of the scheduler.
Using the wrong namespace.
3fill in blank
hard

Fix the error in the Pod spec to correctly use node affinity.

Kubernetes
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: [1]
            operator: In
            values:
            - ssd
Drag options to blanks, or click blank then click option'
Adisktype
Bdisk_type
CdiskType
Ddisk-type
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or camelCase in label keys which do not match node labels.
Misspelling the label key.
4fill in blank
hard

Fill both blanks to create a Pod affinity rule that prefers nodes running Pods labeled 'zone=us-east'.

Kubernetes
spec:
  affinity:
    podAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: [1]
              operator: In
              values:
              - [2]
Drag options to blanks, or click blank then click option'
Azone
Bus-east
Cregion
Dus-west
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up label keys and values.
Using a label value that does not exist on any node.
5fill in blank
hard

Fill all three blanks to define a Pod anti-affinity rule that avoids nodes running Pods with label 'app=frontend'.

Kubernetes
spec:
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: [1]
              operator: [2]
              values:
              - [3]
Drag options to blanks, or click blank then click option'
Aapp
BIn
Cfrontend
DNotIn
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'NotIn' instead of 'In' for anti-affinity.
Using wrong label keys or values.