CKA Workloads and Scheduling 2 — Questions and Answers
Question 1: A DaemonSet is configured without a nodeSelector. On which nodes will it schedule pods?
- Only master nodes
- Only worker nodes
- All nodes in the cluster including control plane (Correct answer)
- Only nodes with the label app=daemon
Correct answer: All nodes in the cluster including control plane
By default, DaemonSets schedule one pod on every node in the cluster, including control-plane nodes, unless tolerations or nodeSelectors restrict placement.
Question 2: Which field in a Pod spec defines the minimum and maximum CPU/memory resources a container may use?
- resources.requests only
- resources.limits only
- resources.requests and resources.limits (Correct answer)
- resources.quota
Correct answer: resources.requests and resources.limits
Both resources.requests (scheduler uses this) and resources.limits (enforced at runtime) must be specified together to fully define container resource bounds.
Question 3: You set a Deployment's strategy type to Recreate. What happens during an update?
- Old pods are terminated before new pods are created (Correct answer)
- New pods are created before old pods are terminated
- Half old and half new pods run simultaneously
- Pods are updated in place without restart
Correct answer: Old pods are terminated before new pods are created
With Recreate strategy, Kubernetes terminates all existing pods before creating new ones, causing a brief downtime.
Question 4: What does the CronJob field .spec.startingDeadlineSeconds control?
- Maximum duration a job may run before being killed
- How many seconds after the scheduled time a job may still start (Correct answer)
- Interval between successive job runs
- Time to wait before retrying a failed job
Correct answer: How many seconds after the scheduled time a job may still start
startingDeadlineSeconds sets the deadline in seconds for starting a job if it misses its scheduled time; missed jobs within this window will still be attempted.
Question 5: Which kubectl command shows the rollout history of a Deployment named 'api'?
- kubectl describe deployment api
- kubectl rollout history deployment/api (Correct answer)
- kubectl get deployment api --history
- kubectl logs deployment/api
Correct answer: kubectl rollout history deployment/api
kubectl rollout history deployment/api lists the revision history for the Deployment, including change causes if annotated.
Question 6: A pod is stuck in 'Pending' state. Which resource type shortage most likely causes this when node capacity appears sufficient?
- ConfigMap not found
- Insufficient PersistentVolume
- Node has a NoSchedule taint the pod doesn't tolerate (Correct answer)
- Service endpoint not ready
Correct answer: Node has a NoSchedule taint the pod doesn't tolerate
A NoSchedule taint on all matching nodes prevents the scheduler from placing the pod, even when CPU/memory is available, causing it to stay Pending.
Question 7: What is the effect of setting terminationGracePeriodSeconds to 0 in a pod spec?
- The pod will never be terminated
- The pod is force-killed immediately without SIGTERM (Correct answer)
- The pod waits indefinitely for graceful shutdown
- The pod restarts instead of terminating
Correct answer: The pod is force-killed immediately without SIGTERM
Setting terminationGracePeriodSeconds to 0 causes Kubernetes to send SIGKILL immediately, bypassing the normal graceful shutdown with SIGTERM.
A DaemonSet is configured without a nodeSelector.
On which nodes will it schedule pods?