How to check k8s deploy history?

8/29/2018

I tried kubectl rollout history deployment/my-app, it returns only No rollout history found.

I think there exists a method to get all the deploy histories. It will be very helpful.

Reference official document: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

-- zseikyocho
deployment
kubernetes

1 Answer

8/29/2018

Use --record while creating the deployment so that it will start recroding the deployment into the ReplicaSet.

$ kubectl create -f deploy.yaml --record=true

Whenever you deploy new version of deployment, the replica set preserves the previous configuration of the deployment. Check the track of deployment and even we can use this for automation. This should be the default option in the kuberentes deployment, but, by default it's set to false.

Then check the status and history using the below commands,

$ kubectl rollout status deploy myapp-deployment
$ kubectl rollout history deploy myapp-deployment

Hope this helps.

-- mohan08p
Source: StackOverflow