This document details a step-by-step procedure to upgrade a StorageOS v2 cluster.
Keep in mind that upgrading a cluster will require minor downtime of applications using StorageOS volumes. However we will take steps to minimize the required downtime as much as possible.
Warning: To reduce downtime, it is recommended to
docker pullthe new StorageOS container image
storageos/node:v2.2.0on the nodes beforehand so that the cluster spins up faster!
First make sure you keep a backup of all the StorageOS yaml files. You can reuse the StorageOSCluster configuration file to easily upgrade your cluster. You can also backup the Statefulset yaml files to keep track of the replicas.
kubectl get pod -n storageos-operator -o yaml > storageos_operator.yaml kubectl get storageoscluster -n storageos-operator -o yaml > storageos_cr.yaml kubectl get statefulset --all-namespaces > statefulset-sizes.yaml
Scale all stateful applications that use StorageOS volumes to 0.
Delete the StorageOSCluster CR.
kubectl delete storageoscluster cluster-storageos -n storageos-operator
Deploy the new operator.
kubectl apply -f https://github.com/storageos/cluster-operator/releases/download/v2.2.0/storageos-operator.yaml
Warning: If you have made changes to the CRDs, Service Account or Cluster Role, make sure you migrate those changes in the StorageOS operator yaml.
Edit the StorageOSCluster Custom Resource (storageos_cr.yaml) with the new node image version.
images: nodeContainer: "storageos/node:v2.2.0"
If you’re not using any of the hardcoded container image versions make sure to delete them as well and only leave the nodeContainer image as shown above.
Make sure to also delete all metadata that you’re not using. The final metadata stanza should be something similar to that:
metadata: name: "cluster-storageos" namespace: "storageos-operator"
Re-create the StorageOSCluster
kubectl create -f storageos_cr.yaml
Wait for all the StorageOS pods to enter the
kubectl get pods -l app=storageos -A -w
Scale your stateful applications back up.
Congratulations, you now have the latest version StorageOS!