DenCowboy
DenCowboy

Reputation: 15086

What does --record do in Kubernetes deployment?

I've seen:

kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record

What is --record doing here? I've tried a deployment with it and without it + scaling/image replacing (set image) + checking rollout status etc but I dont see any difference.

I'm probably missing something here.

Upvotes: 2

Views: 2536

Answers (1)

hariK
hariK

Reputation: 3059

It'll record your changes for a given deployment.

kubectl rollout history deployment.v1.apps/nginx-deployment
deployment.apps/nginx-deployment 
REVISION  CHANGE-CAUSE
1         <none>
2         kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record=true

Later you can rollback using revision number if needed.

Note: You can specify the --record flag to write the command executed in the resource annotation kubernetes.io/change-cause. The recorded change is useful for future introspection. For example, to see the commands executed in each Deployment revision.

Refer here

Upvotes: 4

Related Questions