Removing the LINSTOR Operator v1 Deployment

To migrate a LINSTOR Operator v1 deployment to a v2 deployment you need to temporarily remove the existing Operator v1 deployment from your cluster.

After completing this step, you will not be able to create new volumes, nor attach or detach existing volumes, until you roll out your new deployment. However, storage volumes that are attached to your LINSTOR satellite Pods will continue to function.

This is the third step when migrating the LINSTOR Operator from version 1 (v1) to version 2 (v2).

Prerequisites

To temporarily remove the LINSTOR Operator v1 from your current deployment, you will need to install the following tools:

Scaling Down the Operator Deployment

To prevent the LINSTOR Operator from modifying the existing cluster or its LINSTOR resources, scale down the existing LINSTOR Operator deployment so that there are no replicas of the Operator Pod. To do this, enter the following commands:

helm upgrade linstor-op linstor/linstor --set operator.replicas=0
kubectl rollout status -w deploy/linstor-op-operator

Output from successfully running these commands will show that the Helm release was upgraded and that the Operator deployment was rolled out.

Release "linstor-op" has been upgraded. Happy Helming!
[...]
deployment "linstor-op-operator" successfully rolled out

Removing the Finalizers from LINSTOR Resources

The LINSTOR Operator sets finalizers on the resources that it controls. This prevents the deletion of these resources when the Operator is not running. Remove the finalizers by applying a patch to each of the resources, by entering the following commands:

kubectl patch linstorsatellitesets linstor-op-ns --type merge --patch '{"metadata": {"finalizers": []}}'
kubectl patch linstorcontrollers linstor-op-cs --type merge --patch '{"metadata": {"finalizers": []}}'

Output after each successful kubectl patch command will show that the patch was applied.

[...]
linstorsatelliteset.linstor.linbit.com/linstor-op-ns patched
[...]
linstorcontroller.linstor.linbit.com/linstor-op-cs patched

Removing the LINSTOR Resources

After removing the finalizers, you can delete the LINSTOR resources. This will stop the LINSTOR cluster. To do this, enter the following commands:

kubectl delete linstorcsidrivers/linstor-op
kubectl delete linstorsatellitesets/linstor-op-ns
kubectl delete linstorcontrollers/linstor-op-cs

After each successful kubectl delete command, output will show that the resource was deleted.

[...]
linstorcsidriver.linstor.linbit.com "linstor-op" deleted
[...]
linstorsatelliteset.linstor.linbit.com "linstor-op-ns" deleted
[...]
linstorcontroller.linstor.linbit.com "linstor-op-cs" deleted

Removing the LINSTOR Deployment

As a last step, you can completely remove the LINSTOR Operator v1 Helm deployment, and delete additional resources such as service accounts and role-based access control (RBAC) resources. You can also delete the custom resources (CRDs). To do these tasks, enter the following commands:

helm uninstall linstor-op
kubectl delete crds linstorcsidrivers.linstor.linbit.com linstorsatellitesets.linstor.linbit.com linstorcontrollers.linstor.linbit.com

Output from successful commands will show that the Helm deployment was uninstalled and that resources were deleted.

[...]
release "linstor-op" uninstalled
[...]
customresourcedefinition.apiextensions.k8s.io "linstorcsidrivers.linstor.linbit.com" deleted
customresourcedefinition.apiextensions.k8s.io "linstorsatellitesets.linstor.linbit.com" deleted
customresourcedefinition.apiextensions.k8s.io "linstorcontrollers.linstor.linbit.com" deleted

Removing Additional LINSTOR Components

If you have deployed additional LINSTOR components, such as the High Availability (HA) Controller or LINSTOR Affinity Controller, you also need to remove them. After completing the migration to LINSTOR Operator v2, you can install these components again, if you need to. To delete these additional components, enter the following commands:

helm uninstall linstor-ha-controller
helm uninstall linstor-affinity-controller