Hi, Iam a beginner in kubernetes. I am trying to switch my career and learning D . . .

Saran Raju:
Hi, Iam a beginner in kubernetes. I am trying to switch my career and learning DevOps…

I am following kodeklous’s " kubernectes for absolute beginners – Demo -Deployment - Update and Rollback. portion in the course.

The --record is not working for me.

  1. $ kubectl edit deployment myapp-dep --record
    deployment.apps/myapp-dep edited

  2. $ kubectl rollout history deployment/myapp-dep
    deployment.apps/myapp-dep
    REVISION CHANGE-CAUSE
    1 kubectl edit deployment myapp-dep --record=true

Only one REVISION CHANGE-CAUSE is showing . I have done 3 or 4 rollouts…

Could anyone please explain why its not showing…?

Vinod Kumar Nair:
Hi @Saran Raju, the reason for that is you are trying to record the same change cause over again and again which does not change the revision#. This you can validate by describing your deployment and look for a specific annotation called <http://kubernetes.io/change-cause|kubernetes.io/change-cause>: in the Annotations’ section like shown in this my example :-

vagrant@mykubemaster:~$ kubectl describe deploy nginx
Name: nginx
Namespace: netpol
CreationTimestamp: Thu, 28 Jan 2021 16:08:33 +0000
Labels: app=nginx
env=prod
Annotations: <http://deployment.kubernetes.io/revision|deployment.kubernetes.io/revision>: 2
<http://kubernetes.io/change-cause|kubernetes.io/change-cause>: kubectl set image deploy nginx nginx=nginx:alpine --record=true

Here, I tried to record 2 different things, one was simply editing the existing deployment (by changing the labels, for instance) which is what you are trying to do over again and the second is I then changed the image from Nginx to nginx:alpine which created another revision i.e. 2

vagrant@mykubemaster:~$ kubectl rollout history deploy nginx
deployment.apps/nginx
REVISION CHANGE-CAUSE
1 kubectl edit deploy nginx --record=true
2 kubectl set image deploy nginx nginx=nginx:alpine --record=true

Just note that every action with --record flag creates a change-clause in the annotations section. In your case, that action was the same hence the single entry when you performed rollout history. Hope this helps you :slight_smile:

Tej_Singh_Rana:
To see more details about specific revision. e.g.
for deployment demo and revision 3:

kubectl rollout history deployment demo --revision 3

Saran Raju:
Thank you @Vinod Kumar Nair @Tej_Singh_Rana. I have understood it now…