KCNA Pod Management & Scheduling 5 — Questions and Answers
Question 1: Which scheduler priority mechanism allows critical system pods to preempt lower-priority pods when resources are scarce?
- PriorityClass (Correct answer)
- ResourceQuota
- LimitRange
- HorizontalPodAutoscaler
Correct answer: PriorityClass
A PriorityClass assigns a numeric priority to pods; higher-priority pods can preempt (evict) lower-priority pods to get scheduled.
Question 2: What does `kubectl rollout restart deployment/myapp` do?
- Triggers a rolling restart of all pods in the Deployment without changing the spec (Correct answer)
- Deletes and recreates the Deployment from scratch
- Scales the Deployment to zero then back to the original count
- Rolls back the Deployment to the previous revision
Correct answer: Triggers a rolling restart of all pods in the Deployment without changing the spec
`rollout restart` updates a pod template annotation to trigger a rolling update, cycling all pods while maintaining availability.
Question 3: Which Pod volume type mounts a directory from the host node's filesystem directly into the pod?
- hostPath (Correct answer)
- emptyDir
- configMap
- persistentVolumeClaim
Correct answer: hostPath
A `hostPath` volume mounts a specific path from the underlying node into the pod, giving direct access to host files.
Question 4: A container's `resources.requests` value affects scheduling how?
- The scheduler only places the pod on nodes with at least that much allocatable resource available (Correct answer)
- It sets a hard cap on the resource the container can use
- It triggers autoscaling when the request is exceeded
- It reserves resources at the cluster level via ResourceQuota
Correct answer: The scheduler only places the pod on nodes with at least that much allocatable resource available
Requests are what the scheduler uses to fit pods onto nodes; a node must have sufficient allocatable capacity to satisfy the pod's requests.
Question 5: Which field allows you to configure the scheduler to wait before evicting a pod that fails its `NoExecute` taint toleration?
- tolerationSeconds in the toleration spec (Correct answer)
- terminationGracePeriodSeconds
- failureThreshold in the probe spec
- evictionTimeout in LimitRange
Correct answer: tolerationSeconds in the toleration spec
`tolerationSeconds` on a `NoExecute` toleration sets how long the pod can remain on a tainted node before being evicted.
Question 6: What is the function of an admission controller in the context of pod scheduling?
- Intercepts API requests to validate or mutate pod specs before they are persisted (Correct answer)
- Assigns pods to nodes based on resource availability
- Monitors running pods and evicts them when nodes are under pressure
- Manages the lifecycle of persistent volumes attached to pods
Correct answer: Intercepts API requests to validate or mutate pod specs before they are persisted
Admission controllers run after authentication/authorization and can reject or modify pod creation requests before the object is stored in etcd.
Question 7: Which command shows the resource requests and limits currently set on all containers in a running pod?
- kubectl describe pod <name>
- kubectl top pod <name>
- kubectl get pod <name> -o yaml
- Both A and C show this information (Correct answer)
Correct answer: Both A and C show this information
Both `kubectl describe pod` (in the Containers section) and `kubectl get pod -o yaml` (under resources) display requests and limits.
Which scheduler priority mechanism allows critical system pods to preempt lower-priority pods when resources are scarce?