Courseiva
Container Orchestration →mediumMultiple Choice

KCNA Container Orchestration Practice Question

You are writing a Deployment YAML (apps/v1) for a stateless web application. The application should have 3 replicas and use rolling updates with maxSurge=1 and maxUnavailable=0. Which field should you set under spec.strategy?

⚠ Common exam trap

CNCF often tests the misconception that `maxSurge` and `maxUnavailable` are top-level fields under `spec.strategy`, when in fact they must be nested inside `rollingUpdate` and the `type` must explicitly be set to `RollingUpdate`.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

type: RollingUpdate with rollingUpdate: { maxSurge: 1, maxUnavailable: 0 }

The Deployment's `spec.strategy.type` must be set to `RollingUpdate` to enable a controlled, incremental update of pods. The `rollingUpdate` field then allows you to specify `maxSurge: 1` (one extra pod above the desired count during update) and `maxUnavailable: 0` (ensure all existing pods remain available during the update), which is the exact configuration for a zero-downtime rolling update with a single surge pod.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    type: Recreate

    Why it's wrong here

    Recreate terminates all three pods before starting new ones, causing an outage and violating maxUnavailable=0; only RollingUpdate honours maxSurge and maxUnavailable. It is tempting because Recreate is valid and would be correct for a workload that cannot run two versions concurrently, such as one holding an incompatible schema.

  • ✗

    type: Canary

    Why it's wrong here

    Canary is not a valid spec.strategy.type value in apps/v1; Kubernetes accepts only Recreate and RollingUpdate, so the manifest would be rejected. It is tempting because canary releases are a real progressive-delivery pattern, correctly implemented through separate Deployments or a service mesh rather than this field.

  • ✗

    type: OnDelete

    Why it's wrong here

    OnDelete belongs to a StatefulSet's spec.updateStrategy, not a Deployment's spec.strategy, so the API server would reject it. It is tempting because OnDelete is a genuine Kubernetes update strategy, and it would be the correct choice when you want pods replaced only after manual deletion.

  • ✓

    type: RollingUpdate with rollingUpdate: { maxSurge: 1, maxUnavailable: 0 }

    Why this is correct

    RollingUpdate is the only strategy type supporting maxSurge and maxUnavailable. Setting maxSurge: 1 and maxUnavailable: 0 adds one new pod before terminating any old pod, guaranteeing three available replicas throughout the rollout, exactly as the stem requires.

About these practice questions

Courseiva writes every KCNA question from scratch — 930 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This KCNA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the KCNA exam.