Skip to content

Test: Upgrade Operator From Previous Version (from OperatorHub using OLM)

Joe McCormick edited this page Sep 12, 2023 · 1 revision

Summary

This test is intended to be run while publishing the new version of the Operator. It should be started before the new version is published, then used to verify the Operator is automatically upgraded to the new version after release.

Note this test ONLY verifies the operator install from OperatorHub.

Prerequisites

  • A clean Kubernetes cluster (no previous operator/CSI driver install) with the prerequisites needed to Run Operator With OLM Integration Using kubectl.
    • Notably all prerequisites needed to install the BeeGFS CSI driver must be installed to your Kubernetes nodes. If you are using Minikube there is a script to do this at hack/minikube_install_driver_prerequisites.sh and Minikube must be started with the /etc/beegfs directory from the base OS bind mounted into the Minikube container (so the driver has a base BeeGFS configuration file).

Steps

Step 1: Before Publishing the Operator

  • Create the following namespace, operator group, and subscription in Kubernetes with kubectl apply -f <FILE>.yaml:
apiVersion: v1
kind: Namespace
metadata:
  name: beegfs-csi
  labels:
    name: beegfs-csi
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: beegfs-csi-driver-operator-og
  namespace: beegfs-csi
spec:
  targetNamespaces:
  - beegfs-csi
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: beegfs-csi-driver-operator-subscription
  namespace: beegfs-csi
spec:
  channel: stable
  name: beegfs-csi-driver-operator
  source: operatorhubio-catalog
  sourceNamespace: olm
  • Ensure the operator pod starts as expected.
  • Create a BeeGFSDriver CRD, notably omitting to specify ContainerImageOverride which could override the default image or tag and apply it with kubectl apply -f <FILE>.yaml:
kind: BeegfsDriver
apiVersion: beegfs.csi.netapp.com/v1
metadata:
  name: csi-beegfs-cr # CR must have this name.
  namespace: beegfs-csi
spec:
  pluginConfig:
    # config:
    # fileSystemSpecificConfigs:
  • Ensure the BeeGFS CSI driver is deployed and all pods are started with kubectl get pod -A.
  • Use kubectl describe pod -n beegfs-csi <POD> to verify the container image/version used for the operator, CSI controller, and CSI node service(s).
  • Run kubectl get installplan -n beegfs-csi and verify the install plan approval is set to automatic.

Step 2: After Publishing the Operator

  • After publishing the new Operator version, if all goes well the Operator and CSI driver should be automatically upgraded to the latest version (typically within an hour or two based on past experience).
  • After the automatic upgrade occurs:
    • Verify all pods restarted properly with kubectl get pod -A.
    • Verif the container image/version used for the operator, CSI controller, and CSI node service(s) with kubectl describe pod -n beegfs-csi <POD>.