At the moment I'm performing Kubernetes deployments by applying deployment.yaml
then updating the container/pod image versions with kubectl set-image
as outlined in the docs. I'm doing this using Jenkins.
If I understand correctly, each time I apply kubectl set-image
it updates the deployment in situ creating a new ReplicaSet meaning that I don't need to create a new deployment.yaml
for each version bump.
Is this best practice or should I be creating a new deployment.yaml
every time we bump version?
My next question concerns rollbacks, if I run kubectl rollout history deployment/name
, I see three revisions but no 'cause'. I think this is because I've not specified --record
on the initial deployment, and does that record each time we do a set-version
too?