HiveBrain v1.2.0
Get Started
← Back to all entries
patternkubernetesMinor

Kubernetes Deployments & Rollbacks

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
rollbackskubernetesdeployments

Problem

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?

Solution

I think it might be a good idea to update deployment.yaml for each version/release and commit to git so that later, any other person may follow through and even revert back to an earlier release/version.

Context

StackExchange DevOps Q#4825, answer score: 2

Revisions (0)

No revisions yet.