KCNA Pod Management & Scheduling 3 — Questions and Answers
Question 1: Which field in a container spec sets environment variables from all keys in a ConfigMap?
- envFrom with configMapRef (Correct answer)
- env with valueFrom
- volumes with configMap
- configMapKeyRef
Correct answer: envFrom with configMapRef
`envFrom` with a `configMapRef` injects all key-value pairs from a ConfigMap as environment variables into the container.
Question 2: A node is tainted with `key=value:NoSchedule`. Which pod spec element allows a pod to be scheduled on that node?
- tolerations (Correct answer)
- nodeSelector
- affinity.nodeAffinity
- priorityClassName
Correct answer: tolerations
A toleration matching the taint's key, value, and effect allows the pod to be scheduled on the tainted node.
Question 3: What is the default behavior when a liveness probe fails repeatedly?
- The container is killed and restarted according to the restartPolicy (Correct answer)
- The pod is evicted from the node
- The pod is moved to another node
- The container is paused until the probe succeeds
Correct answer: The container is killed and restarted according to the restartPolicy
When a liveness probe fails beyond `failureThreshold`, Kubernetes kills the container and restarts it per the pod's restartPolicy.
Question 4: Which Pod QoS class is assigned when a container has no resource requests or limits defined?
- BestEffort (Correct answer)
- Burstable
- Guaranteed
- Limited
Correct answer: BestEffort
Pods with no resource requests or limits are classified as BestEffort, the lowest QoS class, and are first to be evicted under pressure.
Question 5: How does Kubernetes handle a static pod if its defining manifest file is deleted from the node?
- The kubelet deletes the running pod automatically (Correct answer)
- The pod continues running until the node reboots
- The API server garbage-collects it after 5 minutes
- An admission controller removes it from the cluster
Correct answer: The kubelet deletes the running pod automatically
The kubelet watches the staticPodPath directory and deletes any running static pod whose manifest file is removed.
Question 6: Which resource type ensures exactly one pod runs on every (or selected) node in the cluster?
- DaemonSet (Correct answer)
- Deployment
- StatefulSet
- ReplicaSet
Correct answer: DaemonSet
A DaemonSet places one pod per matching node and automatically adds pods to new nodes as they join the cluster.
Question 7: What does the `kubectl taint nodes node1 key=val:NoExecute` command do to already-running pods without a matching toleration?
- They are evicted from the node immediately (Correct answer)
- They continue running but new pods can't schedule there
- They are restarted with the taint applied
- They are moved to Pending state until tolerations are added
Correct answer: They are evicted from the node immediately
The `NoExecute` taint effect evicts existing pods that lack a matching toleration, not just prevents new scheduling.
Which field in a container spec sets environment variables from all keys in a ConfigMap?