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 quay.io/coreos/etcd-operator:vX.Y.Z
where 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.
For any 0.4.x
versions, please update to 0.5.0
first.
The 0.5.0
release introduces a breaking change in moving from TPR to CRD. To preserve the cluster state across the upgrade, the cluster must be recreated from backup after the upgrade.
Kubernetes cluster version must be 1.7+.
kubectl -n <namespace> delete cluster <cluster-name>
kubectl delete thirdpartyresource cluster.etcd.coreos.com
ClusterRole
with the new rules for CRD.0.5.0
image.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:
apiVersion
and kind
fields have been changed as mentioned in the 0.5.0
release notesspec.restore
field needs to be specified according your backup configuration. See spec examples guide on how to specify the spec.restore
field for your particular backup configuration.Upgrade to v0.4.0
first.
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 v0.3.x
.
Spec.Backup.MaxBackups
update:
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.