KCNA · Domain 3: Cloud Native Application Delivery · 16% of the exam
Task 3.1: Application Delivery
Rolling updates and rollbacks, blue-green and canary releases, configuration with ConfigMaps and Secrets, packaging with Helm and Kustomize, CI/CD pipelines, and GitOps with Argo CD and Flux.
Blue-green and canary releases, Helm and Kustomize, CI/CD and GitOps
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the CNCF documentation page that proves it.
Question 1 · choose 1
A Deployment runs 4 replicas behind a Service. During every image update the team must never have fewer than 4 Pods available, and a brief extra Pod during the rollout is acceptable. How should the rolling update be configured?
AmaxUnavailable set to 1 and maxSurge set to 0
BmaxUnavailable set to 0 and maxSurge set to 1
CThe Recreate strategy instead of RollingUpdate
DrevisionHistoryLimit set to 0
Show the answer and why
AmaxUnavailable set to 1 and maxSurge set to 0
Incorrect
This removes an old Pod before a new one exists, so availability drops to 3 during the rollout.
BmaxUnavailable set to 0 and maxSurge set to 1
Correct
With no Pods allowed to be unavailable and one extra allowed, the controller starts a new Pod, waits for it to be ready, and only then removes an old one.
CThe Recreate strategy instead of RollingUpdate
Incorrect
Recreate stops every old Pod before creating new ones, which causes downtime.
DrevisionHistoryLimit set to 0
Incorrect
That only controls how many old ReplicaSets are kept for rollback; it has no effect on availability during a rollout.
maxUnavailable caps how many Pods may be missing and maxSurge how many may be added during a rolling update; 0 and 1 keep full capacity at the cost of one extra Pod.
Minutes after a new image is rolled out, a Deployment's error rate jumps. The previous version was healthy, and the team wants it back as fast as possible without editing any manifest. Which command does that?
Akubectl rollout restart deployment/web
Bkubectl scale deployment/web --replicas=0
Ckubectl delete deployment web and re-apply the old manifest
Dkubectl rollout undo deployment/web
Show the answer and why
Akubectl rollout restart deployment/web
Incorrect
restart replaces the Pods but keeps the current, faulty version.
Bkubectl scale deployment/web --replicas=0
Incorrect
Scaling to zero stops the errors by stopping the service entirely.
Ckubectl delete deployment web and re-apply the old manifest
Incorrect
That causes downtime and needs the old manifest at hand, while a built-in rollback exists.
Dkubectl rollout undo deployment/web
Correct
rollout undo rolls the Deployment back to its previous revision, reusing the old ReplicaSet.
Deployments keep their rollout history as old ReplicaSets, so a rollback to the last good revision is a single command.
A new release of a web app cannot run next to the old one because of an incompatible session format. The team wants the new version fully running and tested first, then all traffic switched at once, with a quick way back. Which approach fits?
ABlue-green, bringing up the new Deployment and then switching the Service selector
BA canary release that sends 5% of the traffic to the new version, then more
CA rolling update with maxSurge at 25% so new Pods start before old ones stop
DThe Recreate strategy, which stops the old Pods before starting the new ones
Show the answer and why
ABlue-green, bringing up the new Deployment and then switching the Service selector
Correct
Blue-green keeps two complete environments and switches traffic in one step; switching back is the same change in reverse.
BA canary release that sends 5% of the traffic to the new version, then more
Incorrect
A canary runs both versions side by side and shifts traffic gradually, which the incompatible versions cannot tolerate.
CA rolling update with maxSurge at 25% so new Pods start before old ones stop
Incorrect
A rolling update also mixes old and new Pods behind the Service while it progresses.
DThe Recreate strategy, which stops the old Pods before starting the new ones
Incorrect
Recreate avoids mixing versions, but it removes the old Pods before the new ones are up and tested, so there is downtime and no ready fallback.
When versions cannot coexist and downtime is unacceptable, blue-green lets the new environment be prepared in full and receive the traffic all at once.
A team wants the desired state of its clusters kept in Git, with an agent inside each cluster that continuously compares the cluster with the repository and reverts manual changes. Which practice is this?
AA CI pipeline that runs kubectl apply after each merge
BPackaging the manifests as a Helm chart in a chart repository
CGitOps, using a tool such as Argo CD or Flux
DRecording every kubectl edit in a change ticket
Show the answer and why
AA CI pipeline that runs kubectl apply after each merge
Incorrect
A pipeline pushes changes when it runs; between runs nothing notices or reverts a manual change.
BPackaging the manifests as a Helm chart in a chart repository
Incorrect
Packaging makes resources reusable and installable; it does not keep watching the cluster.
CGitOps, using a tool such as Argo CD or Flux
Correct
GitOps continuously evaluates and reconciles the live state against the state defined in version control, which also undoes drift.
DRecording every kubectl edit in a change ticket
Incorrect
Tickets document changes after the fact; they neither make Git the source of truth nor reconcile anything.
GitOps treats version control as the source of truth and uses automated reconciliation, typically by an in-cluster agent, to keep the live system in line with it.
A team ships the same application to dev and production. Production needs more replicas, a different image tag and extra labels, and the team wants one shared base of manifests rather than two hand-edited copies. Which two tools are built for this? (Choose TWO.)
AHelm, with one chart and a different values file per environment
BA ConfigMap per environment that holds the replica count
CRunning kubectl scale by hand after each production deployment
DKustomize, with a shared base and an overlay per environment
EA HorizontalPodAutoscaler with a different minReplicas per environment
Show the answer and why
AHelm, with one chart and a different values file per environment
Correct
Helm manages packages of pre-configured resources called charts, and values let one chart render differently per environment.
BA ConfigMap per environment that holds the replica count
Incorrect
A ConfigMap feeds configuration to containers; the Deployment's replica field does not read from it.
CRunning kubectl scale by hand after each production deployment
Incorrect
Manual commands drift from the files and still leave the tag and labels unchanged.
DKustomize, with a shared base and an overlay per environment
Correct
Kustomize adds, removes or updates configuration in manifests without templates, and kubectl applies it with -k.
EA HorizontalPodAutoscaler with a different minReplicas per environment
Incorrect
An autoscaler adjusts replicas from metrics, but it cannot change the image tag or labels.
Helm and Kustomize both produce environment-specific manifests from one shared definition: Helm through templated charts and values, Kustomize through bases and overlays.
An application reads its LOG_LEVEL from an environment variable populated from a ConfigMap. The team changed the value in the ConfigMap an hour ago, but the running Pods still log at the old level. What has to happen?
ANothing; the kubelet pushes the new value into the running containers at its next sync
BRestart the Pods, for example with kubectl rollout restart, to load the new value
CMark the ConfigMap immutable so that its new value is enforced
DDelete the ConfigMap and create it again under the same name
Show the answer and why
ANothing; the kubelet pushes the new value into the running containers at its next sync
Incorrect
Periodic syncs refresh ConfigMaps mounted as volumes, not values already injected as environment variables.
BRestart the Pods, for example with kubectl rollout restart, to load the new value
Correct
Environment variables are set when a container starts; ConfigMaps consumed as environment variables are not updated in running Pods.
CMark the ConfigMap immutable so that its new value is enforced
Incorrect
Immutability blocks later changes to the ConfigMap; it does not deliver the new value.
DDelete the ConfigMap and create it again under the same name
Incorrect
Recreating it does not touch the environment of containers that are already running.
Environment values are fixed for the life of a container, so a change reaches the application only through new Pods.
A ConfigMap holds twelve settings, and the application expects each one as an environment variable of the same name. How can the Pod spec load all of them without listing each key?
AenvFrom with a configMapRef to the ConfigMap
Benv with one valueFrom entry per key
CA volume mount of the ConfigMap at /etc/env
DThe downward API with fieldPath set to the ConfigMap
Show the answer and why
AenvFrom with a configMapRef to the ConfigMap
Correct
envFrom defines all of a ConfigMap's data as container environment variables.
Benv with one valueFrom entry per key
Incorrect
That works but lists every key by hand, which the team wants to avoid.
CA volume mount of the ConfigMap at /etc/env
Incorrect
A volume mount gives files, not environment variables.
DThe downward API with fieldPath set to the ConfigMap
Incorrect
The downward API exposes Pod fields, not ConfigMap data.
envFrom imports a whole ConfigMap as environment variables; env with valueFrom picks single keys.
A data team wants to define multi-step pipelines in which each step runs in its own container on Kubernetes, with dependencies between steps. What should the team use?
AA CronJob for each step, timed so they do not overlap
BOne Job whose script runs each step in turn
CArgo, with its Kubernetes-native workflow engine
DA Deployment with one init container per step
Show the answer and why
AA CronJob for each step, timed so they do not overlap
Incorrect
Timed jobs do not express dependencies between steps.
BOne Job whose script runs each step in turn
Incorrect
One script hides the steps from Kubernetes and loses per-step containers.
CArgo, with its Kubernetes-native workflow engine
Correct
Argo provides Kubernetes-native tools to run workflows, among other things.
DA Deployment with one init container per step
Incorrect
Init containers prepare a Pod; they do not form a pipeline with dependencies of its own.
Workflow engines such as Argo Workflows model steps and dependencies as containers on the cluster.
A pipeline must check that manifests would be accepted by the cluster, including its admission policies, without creating or changing anything. Which command does that?
Akubectl apply --dry-run=client -f manifests/
Bkubectl create --save-config -f manifests/
Ckubectl explain on each kind in the manifests
Dkubectl apply --dry-run=server -f manifests/
Show the answer and why
Akubectl apply --dry-run=client -f manifests/
Incorrect
A client dry run only prints the objects locally; the cluster's admission never sees them.
Bkubectl create --save-config -f manifests/
Incorrect
That creates the objects for real.
Ckubectl explain on each kind in the manifests
Incorrect
explain documents fields; it validates nothing.
Dkubectl apply --dry-run=server -f manifests/
Correct
A server dry run submits the request to the API server, including admission, without persisting the objects.
Server-side dry runs go through validation and admission, so they catch what the cluster would reject.