Upgrade StorageOS

Procedure to upgrade a StorageOS v2 Cluster

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 image storageos/node:v2.3.4 on the nodes beforehand so that the cluster spins up faster!

  1. 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
  2. Scale all stateful applications that use StorageOS volumes to 0.

  3. 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
  4. Deploy the new operator.

    kubectl apply -f https://github.com/storageos/cluster-operator/releases/download/v2.3.4/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.

  5. Edit the StorageOSCluster Custom Resource (storageos_cr.yaml) with the new node image version.

        nodeContainer: "storageos/node:v2.3.4"

    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:

        name: "cluster-storageos"
        namespace: "storageos-operator"
  6. Re-create the StorageOSCluster

    kubectl create -f storageos_cr.yaml
  7. Wait for all the StorageOS pods to enter the RUNNING state

    kubectl get pods -l app=storageos -A -w
  8. Scale your stateful applications back up.

Congratulations, you now have the latest version StorageOS!