Updating with the kubectl set command

Updating the container image is a very common task. You may also update that value directly with the kubectl set command, as we mentioned previously. If the deployment resource has the change-cause annotation added, then using the kubectl set command will update the annotation as you make changes. For example:

# delete the deployment entirelykubectl delete deployment flaskdeployment "flask" deleted
# create a new deployment with the run commandkubectl run flask --image=quay.io/kubernetes-for-developers/flask:latestdeployment "flask" created
# add the initial annotation for change-causekubectl annotate deployment/flask kubernetes.io/change-cause='initial deployment'deployment "flask" annotated
# update ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.