KCNA Pod Management & Scheduling 4 — Questions and Answers
Question 1: Which field enables a Pod to run as a specific user ID at the container level?
- securityContext.runAsUser (Correct answer)
- podSpec.userId
- containerSpec.uid
- metadata.annotations.runAs
Correct answer: securityContext.runAsUser
Setting `securityContext.runAsUser` in a container spec makes the container process run as the specified UID.
Question 2: What is the role of the `scheduler.alpha.kubernetes.io/node` annotation on a Pod?
- It manually assigns the pod to a specific node, bypassing the scheduler (Correct answer)
- It sets a preferred node for the scheduler to consider
- It records which node the pod last ran on
- It configures which scheduler plugin handles this pod
Correct answer: It manually assigns the pod to a specific node, bypassing the scheduler
Setting `nodeName` (or the legacy node annotation) bypasses the scheduler entirely and directly binds the pod to the named node.
Question 3: A readiness probe failing on a pod causes which behavior?
- The pod's IP is removed from the Service's Endpoints, stopping traffic (Correct answer)
- The container is killed and restarted
- The pod is rescheduled to another node
- The pod is deleted and replaced by the controller
Correct answer: The pod's IP is removed from the Service's Endpoints, stopping traffic
A failing readiness probe removes the pod from Service endpoints so no traffic is routed to it, without killing the container.
Question 4: Which Kubernetes concept allows a pod to request exclusive access to a GPU or custom device on a node?
- Device Plugins and resource limits with extended resources (Correct answer)
- Node Affinity with hardware labels
- ResourceQuota with GPU class
- LimitRange with deviceType
Correct answer: Device Plugins and resource limits with extended resources
Device Plugins expose custom resources (like `nvidia.com/gpu`) that pods can request via `resources.limits` in their container spec.
Question 5: What happens to pods managed by a ReplicaSet when you manually delete one of them?
- The ReplicaSet controller creates a replacement pod to maintain the desired replica count (Correct answer)
- The pod is permanently removed and the count decreases
- The pod is restarted in place without creating a new one
- An alert is sent but no automatic action is taken
Correct answer: The ReplicaSet controller creates a replacement pod to maintain the desired replica count
The ReplicaSet controller continuously reconciles actual vs desired state and immediately creates a new pod to replace the deleted one.
Question 6: Which field in a Pod spec prevents a pod from being scheduled on a node that already runs a pod with a matching label?
- affinity.podAntiAffinity (Correct answer)
- affinity.nodeAffinity
- topologySpreadConstraints
- tolerations
Correct answer: affinity.podAntiAffinity
`podAntiAffinity` rules repel a pod from nodes that already host pods matching the specified label selector.
Question 7: In Kubernetes, what is a 'sidecar container' pattern?
- An auxiliary container in the same Pod that extends or supports the main application container (Correct answer)
- A dedicated node reserved for monitoring workloads
- A secondary Deployment that mirrors the primary one
- A container that runs before the main container and then exits
Correct answer: An auxiliary container in the same Pod that extends or supports the main application container
A sidecar is a co-located container in the same pod that provides supporting functionality like logging, proxying, or config sync alongside the main app.
Which field enables a Pod to run as a specific user ID at the container level?