-
Notifications
You must be signed in to change notification settings - Fork 18
Test: Upgrade Operator From Previous Version (using operator‐sdk)
The purpose of this test is to verify that upgrading from the previous operator version (through Openshift) works as expected. This test can be difficult to set up before the driver, operator, and operator bundle are pushed out into the world because the operator bundle is built to reference the operator's canonical repo and the operator is built to reference the driver's canonical repo. The most practical approach is to use operator-sdk to deploy the bundle from the previous version and to then use operator-sdk to upgrade to a new version of the bundle.
- A Kubernetes cluster with the prerequisites needed to Run Operator With OLM Integration Using kubectl.
- Access to the operator bundle for the previous and current version of the driver.
- Only a limited number of test packages are retained. If needed checkout the tag for the previous version and follow these steps to generate the operator bundle for the previous version.
-
Deploy the previous version of the operator using operator-sdk using the canonical bundle image created for it on the last release:
operator-sdk run bundle <IMAGE_NAME>-bundle:<TAG> -n beegfs-csi
-
Deploy a BeegfsDriver custom resource:
- Ensure not to accidentally specify
containerImageOverrides
to ensure we can test the upgrade. - Wait for the driver to deploy successfully.
-
Deploy the current version of the operator using operator-sdk on the appropriate bundle built by GitHub actions:
operator-sdk run bundle-upgrade <IMAGE_NAME>-bundle:<TAG> -n beegfs-csi
-
Verify the following:
- The operator pod has been recreated.
- The operator pod is running the latest image version.
- The operator pod logs indicate it updated the controller service StatefulSet and node service DaemonSet (more than 1 operator pod).
- The controller service pod has been recreated.
- The controller service StatefulSet is running the latest image version.
- All node service pods have been recreated
- The node service DaemonSet is running the latest image version
- A properly configured examples/k8s/dyn runs correctly (may need to add a label so a proper node is selected)
- If desired cleanup by running:
operator-sdk cleanup beegfs-csi-driver-operator -n beegfs-csi