This document shows how to safely upgrade the operator to a desired version while preserving the cluster's state and data whenever possible. It is assumed that the preexisting cluster is configured to create and store backups to persistent storage. See the backup config guide for details.
First create a backup of your current cluster before starting the upgrade process. See the backup service guide on how to create a backup.
In the case of an upgrade failure you can restore your cluster to the previous state from the previous backup. See the spec examples on how to do that.
An in-place update can be performed when the upgrade is compatible, i.e we can upgrade the operator without affecting the cluster.
To upgrade an operator deployment the image field
spec.template.spec.containers.image needs to be changed via an in-place update.
Change the image field to
vX.Y.Z is the desired version.
$ kubectl edit deployment/etcd-operator # make the image change in your editor then save and close the file
In the case of an incompatible upgrade, the process requires restoring a new cluster from backup. See the incompatible upgrade guide for more information.
0.4.x versions, please update to
Kubernetes cluster version must be 1.7+.
kubectl -n <namespace> delete cluster <cluster-name>
kubectl delete thirdpartyresource cluster.etcd.coreos.com
ClusterRolewith the new rules for CRD.
apiVersion: "etcd.database.coreos.com/v1beta2" kind: "EtcdCluster" metadata: name: <cluster-name> spec: size: <cluster-size> version: "3.1.8" backup: # The same backup spec used to save the backup of the previous cluster . . . . . . restore: backupClusterName: <previous-cluster-name> storageType: <storage-type-of-backup-spec>
The two points of interest in the above CR spec are:
kindfields have been changed as mentioned in the
spec.restorefield needs to be specified according your backup configuration. See spec examples guide on how to specify the
spec.restorefield for your particular backup configuration.
See the release notes of
v0.4.0 for noticeable changes: https://github.com/coreos/etcd-operator/releases/tag/v0.4.0
To upgrade to
v0.3.x the current operator verison must first be upgraded to
v0.2.6+, since versions <
v0.2.6 are not compatible with
Spec.Backup.MaxBackups < 0, previously it had no effect. Now it will get rejected. Please remove it.
Spec.Backup.MaxBackups == 0, previously it had no effect. Now it will create backup sidecar that allows unlimited backups. If you don't want backup sidecar, just don't set any backup policy.