Skip to content

Commit

Permalink
docs: Add steps to remove v1 deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wanzenböck <[email protected]>
  • Loading branch information
WanzenBug committed Dec 1, 2023
1 parent 68a0562 commit 27722e2
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions docs/how-to/upgrade/3-remove-operator-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Remove the Piraeus Operator v1 Deployment

Migrating to the new Piraeus Operator deployment requires temporarily removing the existing deployment.

After this step no new volumes can be created and no existing volume can be attached or detached, until the
new deployment is rolled out.

This is the third step when migrating Piraeus Operator from version 1 (v1) to version 2 (v2).
[Click here to get back to the overview](./index.md).

## Prerequisites

* [Install `kubectl`](https://kubernetes.io/docs/tasks/tools/)
* [Install `helm`](https://docs.helm.sh/docs/intro/install/)

## Scale Down the Operator Deployment

To prevent modification of the existing cluster, scale down the existing Piraeus Operator deployment.

```
$ helm upgrade piraeus-op ./charts/piraeus --set operator.replicas=0
$ kubectl rollout status -w deploy/piraeus-op-operator
deployment "piraeus-op-operator" successfully rolled out
```

## Remove the Finalizers from the Piraeus Resources

The Operator sets Finalizers on the resource it controls. This prevents the deletion of these resources when the
Operator is not running. Remove the Finalizers by applying a patch:

```
$ kubectl patch linstorsatellitesets piraeus-op-ns --type merge --patch '{"metadata": {"finalizers": []}}'
linstorsatelliteset.piraeus.linbit.com/piraeus-op-ns patched
$ kubectl patch linstorcontrollers piraeus-op-cs --type merge --patch '{"metadata": {"finalizers": []}}'
linstorcontroller.piraeus.linbit.com/piraeus-op-cs patched
```

## Remove the Piraeus Resources

Having removed the Finalizers, you can delete the Piraeus Resources. This will stop the LINSTOR Cluster, and no
new volumes can be created, and existing volumes will not attach or detach. Volumes already attached to a Pod will
continue to replicate.

```
$ kubectl delete linstorcsidrivers/piraeus-op
$ kubectl delete linstorsatellitesets/piraeus-op-ns
$ kubectl delete linstorcontrollers/piraeus-op-cs
```

## Remove the Piraeus Deployment

As a last step, you can completely remove the helm deployment, deleting additional resources such as service accounts
and RBAC resources. In addition, also clean up the Custom Resource Definitions:

```
$ helm uninstall piraeus-op
$ kubectl delete crds linstorcontrollers.piraeus.linbit.com linstorsatellitesets.piraeus.linbit.com linstorcontrollers.piraeus.linbit.com
```

## Optional: Remove additional Piraeus Components

If you have deployed additional components from Piraeus, such as the HA Controller or LINSTOR Affinity Controller, you
will need to remove them, too. After completing the migration, you can install them again, if needed.

```
$ helm uninstall piraeus-ha-controller
$ helm uninstall linstor-affinity-controller
```

0 comments on commit 27722e2

Please sign in to comment.