Upgrade StorageOS
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.
Upgrade StorageOS
Ensure that you have read the PIDs prerequisite introduced in StorageOS v2.3 and that you check the init container logs to ensure your environments PID limits are set correctly.
Warning: To reduce downtime, it is recommended to
docker pull
the new StorageOS container imagestorageos/node:v2.4.0-rc.1
on 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
If you have renamed the
StorageOSCluster
resource you can find it by using the command below.kubectl get storageoscluster --all-namespaces
-
Deploy the new operator.
kubectl apply -f https://github.com/storageos/cluster-operator/releases/download/v2.4.0-rc.1/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.4.0-rc.1"
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
RUNNING
statekubectl get pods -l app=storageos -A -w
-
Scale your stateful applications back up.
Congratulations, you now have the latest version StorageOS!