Certified Kubernetes Administrator (CKA) Practice Test

Question: 1 / 400

What is the method to update the image of a Pod in a Deployment?

Modify the Pod specification directly

Use the `kubectl update pod` command

Change the Deployment manifest or use `kubectl set image`

To update the image of a Pod in a Deployment, modifying the Deployment manifest or using the `kubectl set image` command is the preferred approach. This method ensures that the Deployment controller manages the rollout process, allowing for a controlled and systematic update of the Pods.

When you change the Deployment manifest, you are updating the desired state defined within the Deployment object. Kubernetes will then compare this new desired state with the current state and initiate a rollout to update the Pods accordingly. This process includes managing the update process for you, such as ensuring that old Pods are terminated gradually in a way that maintains application availability.

Using the `kubectl set image` command achieves the same effect without having to manually edit the entire manifest. This command allows you to specify which container in the Deployment needs its image updated, streamlining the update process. Kubernetes will then manage the rollout of the new Pods with the updated image.

In contrast, modifying the Pod specification directly would not work as intended because Pods are managed by the Deployment; changes to individual Pods are overridden by the Deployment's definition. The `kubectl update pod` command does not exist for updating image configurations and could lead to confusion. Recreating the Deployment from scratch would also disrupt the current state and may lead to

Get further explanation with Examzify DeepDiveBeta

Recreate the Deployment from scratch

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy