Conquer the CKAD Challenge 2025: Unleash Your Kubernetes Power!

Question: 1 / 400

How do you apply a YAML configuration file in Kubernetes?

kubectl create -f [file.yaml]

kubectl apply -f [file.yaml]

Applying a YAML configuration file in Kubernetes is done using the command `kubectl apply -f [file.yaml]`. This command is specifically designed to create or update resources defined within the specified YAML file.

Using `kubectl apply` ensures that you are not only creating a resource if it doesn’t already exist but also updating it if it has been modified. This is particularly useful when managing applications because it allows for incremental updates and maintains the state of the resources.

The apply command takes care of figuring out which resources need to be created or updated based on their configuration in the file and the current state in the Kubernetes cluster, making it a powerful tool for managing cluster resources effectively.

In contrast, the other options are not valid for applying a YAML configuration file. The `create` command indeed can create resources, but it does not handle updates; it will fail if the resource already exists. The `load` command is not a recognized kubectl command, and `deploy` is not a command for applying YAML files directly either; it is part of a different workflow primarily focused on creating deployments specifically.

Get further explanation with Examzify DeepDiveBeta

kubectl load -f [file.yaml]

kubectl deploy -f [file.yaml]

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy