Google Cloud Certified Associate Cloud Engineer Practice

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Google Cloud Certified Associate Cloud Engineer Exam with flashcards and multiple choice questions. Each question includes hints and explanations to help you study effectively. Get ready to pass your certification exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What command is used to update a Kubernetes deployment that was created with the `kubectl create` command?

  1. `kubectl update`

  2. `kubectl replace`

  3. `kubectl apply`

  4. `kubectl modify`

The correct answer is: `kubectl apply`

The correct command to update a Kubernetes deployment that was created with the `kubectl create` command is `kubectl apply`. This command is designed to apply changes to a resource by updating the current state of the resource in the cluster based on the configuration specified in a YAML or JSON file. When a deployment needs to be modified, using `kubectl apply` is particularly effective because it allows Kubernetes to manage the desired state of the resource based on the new configuration you provide, ensuring that only the necessary changes are made. This approach aligns with the declarative model of configuration management in Kubernetes, where the desired state is always maintained. While there are other commands like `kubectl replace`, which can entirely replace an existing resource with a new definition, this may lead to downtime for the resource being updated. In contrast, `kubectl apply` intelligently handles incremental updates, maintaining operational stability during the update process.