--record has been deprecated, then what is the alternative
10 Jan 2024, 19:39 UTC
When I am running the below command to record the change cause -
kubectl set image deployment.v1.apps/deploy1 nginx=nginx:1.16.0 --record
Then it records the change cause but shows that --record has been deprecated.
Flag --record has been deprecated, `--record` will be removed in the future
deployment.apps/deploy1 image updated
And when I run the command kubectl set image deployment.v1.apps/deploy1 nginx=nginx:1.16.0 without --record then it does not record the change cause.
So my question is if the --record has been deprecated and with be removed in the future then what is the easy alternative of that to record change? ( I mean to record the command using which I have done rollout ).
Thanks in advance.
1 answer
Accepted answer · original discussion
12 Jan 2024, 19:39 UTC
Not sure if it's deprecated or will be fully.
You can use the annotate to manage the history same way.
Create the deployment
kubectl create deployment nginx --image=nginx:1.16.0 --replicas 1check the history
kubectl rollout history deployment nginxupdate the image on deployment
kubectl set image deployment nginx nginx=nginx:latestAnnotate the deployment now and create the history
kubectl annotate deployment nginx kubernetes.io/change-cause="version change to 1.16.0 to latest" --overwrite=trueCheck the history
kubectl rollout history deployment nginx
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
14 Jan 2024, 19:39 UTC