Doubt setting an image in a deployment

Create a deploment with the image tomcat 10.0-jdk14-openjdk-oracle with 3 replicas. Later we have to update this image change it for jdk8-adoptopenjdk-hotspot, and we must record this change, later we create another change with image 8-jdk14-openjdk-oracle, and Finally we must to revert to a first solution.
I would do it , is it correct?

kubectl create deployment tomcat-app --image=10.0-jdk14-openjdk-oracle --record
kubectl rollout status deploy tomcat-app
kubectl set image deploy tomcat-app tomcat-app=jdk8-adoptopenjdk-hotspot --record=true
kubectl set image deploy tomcat-app tomcat-app=8-jdk14-openjdk-oracle --record=true
kubectl rollout undo deploy tomcat-app --to-revision=1

Yeah you did correct.

1 Like