Courseiva
Application Deployment →mediumMultiple Choice

CKAD Application Deployment Practice Question

You have a Kustomize overlay that sets 'replicas: 5' in a patch, but the base Deployment has 'replicas: 3'. What is the final number of replicas after applying 'kubectl apply -k overlay/'?

⚠ Common exam trap

The trap here is that candidates mistakenly think Kustomize merges or adds values from base and overlay, similar to Helm's merge behavior, when in fact Kustomize patches override scalar fields completely.

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

✓

5

In Kustomize, overlays are applied on top of the base, and patches override the base values. Since the overlay explicitly sets 'replicas: 5' via a patch, it replaces the base value of 3. The final Deployment will have 5 replicas, making D correct.

Answer analysis

Option-by-option breakdown

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

  • ✗

    3

    Why it's wrong here

    The base Deployment likely specifies replicas: 3, but the overlay's patch explicitly sets replicas: 5. Kustomize applies overlays by patching the base object; any field specified in the patch, including a scalar like replicas, replaces the base value. Therefore, the final manifest has 5 replicas, not 3, because the overlay's patch takes precedence over the base's original setting.

  • ✗

    8

    Why it's wrong here

    Replicas are not additive in Kustomize. If you expect 8, you might be thinking that the base's 3 replicas are added to the overlay's 5, but Kustomize does not combine counts. The overlay patches a single Deployment object, and the replicas field is replaced — not summed — by the value in the patch. Thus, the result is 5, not 8.

  • ✗

    It depends on the strategy

    Why it's wrong here

    Kustomize's patch behavior for a scalar field like replicas is deterministic and does not depend on the chosen patch strategy (strategic merge vs. JSON patch). Both strategies replace the existing value with the patch's value; neither sums nor merges scalar fields differently. Overlays are designed to override base values predictably, so there is no scenario where the result varies based on strategy.

  • ✓

    5

    Why this is correct

    The overlay explicitly sets replicas: 5 in its patch, so Kustomize uses exactly that value in the final output. Since overlays take precedence over base values, the base's original replica count is overwritten. This is the core of how Kustomize enables environment-specific customizations: the overlay's patch always wins for fields it specifies, making 5 the correct and deterministic result.

About these practice questions

One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 CKAD 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 CKAD exam.