Courseiva
Cloud Native Architecture →mediumMultiple Choice

KCNA Cloud Native Architecture Practice Question

Which command would you use to apply a manifest file 'deployment.yaml' to a Kubernetes cluster?

⚠ Common exam trap

KCNA often tests the difference between imperative and declarative kubectl commands, so the trap is picking kubectl create -f because it also accepts a file, ignoring that create is not idempotent and fails on re-application.

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

✓

kubectl apply -f deployment.yaml

kubectl apply -f deployment.yaml is the declarative command that creates or updates resources from a manifest file, reconciling the desired state in the file with the cluster's current state. The -f flag specifies the file, and apply is idempotent — running it repeatedly produces the same result. This is the standard way to deploy manifests in Kubernetes.

Answer analysis

Option-by-option breakdown

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

  • ✗

    kubectl run deployment.yaml

    Why it's wrong here

    kubectl run launches a single pod or container from command-line flags; it does not parse a manifest file, so deployment.yaml is treated as an image name. It is tempting because it creates workloads, which would be the right choice for quickly starting an ad-hoc pod for testing.

  • ✗

    kubectl set image deployment.yaml

    Why it's wrong here

    kubectl set image updates the container image of an existing workload; it does not read a manifest file to create or apply resources. It is tempting because it modifies deployments, which would be the right choice when rolling out a new image tag to a running deployment.

  • ✓

    kubectl apply -f deployment.yaml

    Why this is correct

    kubectl apply -f deployment.yaml submits the manifest declaratively, creating or updating the resources it defines to match the desired state. Alternatives such as create fail on existing resources, and get or describe only read cluster state.

  • ✗

    kubectl create -f deployment.yaml

    Why it's wrong here

    kubectl create -f applies a manifest only when the resource does not already exist, failing on subsequent runs; kubectl apply reconciles existing objects. It is tempting because it does read the YAML file, which would be the right choice for one-off creation of a resource not yet in the cluster.

About these practice questions

One of 930 original KCNA 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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CNCF exam blueprint

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.