Which command applies the configurations from a manifest.yaml file to create or update resources in a Kubernetes cluster?

Prepare for the Kubernetes Certified Network Administrator (KCNA) exam with our detailed tests. Use flashcards and multiple choice questions, complete with hints and explanations, to enhance your learning experience. Get exam-ready today!

Multiple Choice

Which command applies the configurations from a manifest.yaml file to create or update resources in a Kubernetes cluster?

Explanation:
Applying configurations from a manifest to create or update resources in a Kubernetes cluster is done with kubectl apply -f manifest.yaml. This command reads the YAML manifest and reconciles the cluster state to match what’s described. If a resource doesn’t exist, apply creates it; if it does exist, apply updates its fields to align with the manifest. This gives you a single, repeatable way to manage desired state and keeps changes idempotent across runs. Using kubectl create -f manifest.yaml would only create resources and can fail if a resource already exists or you want to update something later. kubectl run is for launching a single pod or container and isn’t designed for applying a full multi-resource manifest. There isn’t a kubectl update command in standard Kubernetes tooling.

Applying configurations from a manifest to create or update resources in a Kubernetes cluster is done with kubectl apply -f manifest.yaml. This command reads the YAML manifest and reconciles the cluster state to match what’s described. If a resource doesn’t exist, apply creates it; if it does exist, apply updates its fields to align with the manifest. This gives you a single, repeatable way to manage desired state and keeps changes idempotent across runs.

Using kubectl create -f manifest.yaml would only create resources and can fail if a resource already exists or you want to update something later. kubectl run is for launching a single pod or container and isn’t designed for applying a full multi-resource manifest. There isn’t a kubectl update command in standard Kubernetes tooling.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy