CKAD Pod Design and Deployments 2 — Questions and Answers
Question 1: Which annotation is required on a Deployment to enable revision history tracking for rollbacks?
- kubernetes.io/change-cause (Correct answer)
- kubernetes.io/rollback-cause
- deployment.kubernetes.io/revision
- kubectl.kubernetes.io/last-applied
Correct answer: kubernetes.io/change-cause
The 'kubernetes.io/change-cause' annotation records a human-readable reason for each revision, visible in 'kubectl rollout history'.
Question 2: A Deployment has 'revisionHistoryLimit: 3'. What does this mean?
- Only 3 pods can be updated at a time
- Only the last 3 ReplicaSets are kept for rollback (Correct answer)
- Rollouts pause after 3 revisions
- Only 3 concurrent rollouts are allowed
Correct answer: Only the last 3 ReplicaSets are kept for rollback
'revisionHistoryLimit' controls how many old ReplicaSets are retained for rollback purposes.
Question 3: What happens to a Deployment when you run 'kubectl rollout pause deployment/myapp'?
- All pods are terminated
- The rollout is paused and no further changes are propagated (Correct answer)
- The deployment is deleted
- Existing pods are restarted
Correct answer: The rollout is paused and no further changes are propagated
Pausing a deployment halts the rollout so you can make multiple changes before resuming, acting as a canary mechanism.
Question 4: Which field in a Pod spec defines the node selection using key-value pairs that must exactly match node labels?
- nodeSelector (Correct answer)
- affinity
- tolerations
- nodeName
Correct answer: nodeSelector
'nodeSelector' is the simplest node constraint, requiring pods to be scheduled only on nodes with matching labels.
Question 5: What is the effect of setting 'minReadySeconds: 30' in a Deployment?
- Pods must be ready for 30 seconds before the rollout proceeds (Correct answer)
- Rollout waits 30 seconds before starting
- Pods have 30 seconds to become healthy or are killed
- The deployment waits 30 seconds between waves
Correct answer: Pods must be ready for 30 seconds before the rollout proceeds
'minReadySeconds' ensures a new pod has been Running and Ready for at least that duration before it counts as available.
Question 6: How do you scale a Deployment named 'frontend' to 5 replicas using an imperative command?
- kubectl set replicas deployment/frontend 5
- kubectl scale deployment/frontend --replicas=5 (Correct answer)
- kubectl resize deployment/frontend 5
- kubectl update deployment/frontend --replicas=5
Correct answer: kubectl scale deployment/frontend --replicas=5
'kubectl scale deployment/<name> --replicas=<n>' imperatively adjusts the replica count of a Deployment.
Which annotation is required on a Deployment to enable revision history tracking for rollbacks?