Task
This article details how to rollback the Kubernetes version of a Rancher v2.x provisioned cluster.
Important Note:
A Kubernetes Cluster Rollback will most definitely cause downtime in the cluster, as you are restoring a snapshot from before the upgrade and the cluster will have to reconcile state.
Pre-requisites
- In order to rollback your Kubernetes cluster version upgrade, you need to have first taken an etcd snapshot from before the upgrade. You should keep the reference to the snapshot name that was created as your "pre-upgrade" snapshot. In my cluster which has cluster ID:
c-q8st7
, my snapshot name wasc-q8st7-ml-qdxdh
. Our example upgrade is fromv1.14.9-rancher1-2
tov1.15.7-rancher1-1
.
Rollback operation
In order to rollback, you must:
- Edit Cluster
- Edit as YAML
- Set
kubernetes_version
back tov1.14.9-rancher1-2
(or whatever your desired restore version is) -
Find the
restore
key in the YAML.You will need to update the following configuration:
rancher_kubernetes_engine_config: restore: restore: false
You'll want to closely model the following:
rancher_kubernetes_engine_config: restore: restore: true snapshot_name: "c-q8st7:c-q8st7-ml-qdxdh"
Note the
snapshot_name
has the cluster ID prefixed to it with a:
. -
Finally, you can save the cluster, and observe the snapshot restore + K8s version rollback occur.
Comments
Please sign in to leave a comment.