QuestionQ162

VerifiedKubernetes Fundamentals

In a Kubernetes environment, which of these kubectl patch commands correctly changes a container image in a Deployment without recreating the Deployment resource?

Explanation

A Deployment stores its Pod specification at spec.template.spec; therefore, its container list is at spec.template.spec.containers. A strategic merge patch at that path, with the container name as the merge key, updates the image on the existing Deployment object. The revised Pod template can trigger a rollout of replacement Pods, but it does not recreate the Deployment resource.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!