User12547645
User12547645

Reputation: 8497

Is it possible to roll back services?

In k8s you can roll back a deployment. Can you also roll back a service?

Rolling back a service may be helpful if there was an erroneous update done to a service resource.

Upvotes: 3

Views: 1263

Answers (2)

Harsh Manvar
Harsh Manvar

Reputation: 30178

There is no option to roll back the service as answered by confused genius, however just adding my 50 cents.

If you are using the Helm chart for deployment you could implement some way to roll back all resources if your deployment fails.

So while upgrading the helm release version you can use the --atomic which will auto roll back the resources if your deployment fails.

$ helm upgrade --atomic -f myvalues.yaml -f override.yaml redis ./redis

--atomic if set, upgrade process rolls back changes made in case of failed upgrade. The --wait flag will be set automatically if --atomic is used

Read more about the atomic helm

But again there is no default support for SVC to roll back like deployment.

Upvotes: 2

confused genius
confused genius

Reputation: 3284

rollback / rollout undo is not available for service resource:

kubectl rollout
Manage the rollout of a resource.

 Valid resource types include:

  *  deployments
  *  daemonsets
  *  statefulsets

Upvotes: 3

Related Questions