Conquer the CKAD Challenge 2025: Unleash Your Kubernetes Power!

Image Description

Question: 1 / 400

How can you update a deployment in Kubernetes?

kubectl modify deployment [deployment-name]

kubectl apply -f [deployment-file.yaml]

kubectl edit deployment [deployment-name]

Both B and C

Updating a deployment in Kubernetes can be effectively performed using two specific commands, both of which are included in the correct answer.

Using the command that involves applying a deployment file allows changes to be made by updating the specifications defined in a YAML file. By using the command `kubectl apply -f [deployment-file.yaml]`, you can modify various aspects of the deployment, such as the number of replicas, container images, environment variables, or any other configuration details outlined in the file. This method is particularly useful for applying batch changes and maintaining version control over your deployment specifications.

The command that involves editing the deployment directly, `kubectl edit deployment [deployment-name]`, opens the current configuration of the specified deployment in your default text editor. This allows for real-time modifications to the deployment. Once you save and exit the editor, Kubernetes will automatically update the deployment with the new specifications you've provided. This method is handy for quick changes or tweaks without needing to manage separate YAML files.

Both methods are valid and offer flexibility depending on whether you're working with a file or making on-the-fly adjustments. Thus, the combined approach of using both the apply command with a deployment file and the edit command results in the correct choice.

Get further explanation with Examzify DeepDiveBeta
Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy