Skip to content

Commit

Permalink
docs: guide for deploying v2 after removing 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 27722e2 commit 5b624a5
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 5 deletions.
94 changes: 94 additions & 0 deletions docs/how-to/upgrade/4-install-operator-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Install Piraeus Operator v2

After removing the Piraeus Operator v1 deployment, you can install Piraeus Operator v2.

You can either use the `kubectl` method to deploy Piraeus Operator, or alternatively deploy the Operator using Helm.

This is the last 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/)

## Deploy Piraeus Operator v2 Using `kubectl`

You can use `kubectl` and the built-in `kustomize` feature to deploy Piraeus Operator v2.

First, create a file named `kustomization.yaml`, referencing the latest Piraeus Operator release, and the
namespace you which to deploy the Piraeus Operator in. The latest releases are available on the [release page].

In the example below, the version is `v2.3.0`, and the namespace is `piraeus-datastore`.

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/piraeusdatastore/piraeus-operator//config/default?ref=v2.3.0 # Change the version here
namespace: piraeus-datastore # Change the namespace here
```
Then, deploy the Operator using `kubectl` and wait for the deployment to complete:

```
$ kubectl apply -k . --server-side
$ kubectl rollout status -n piraeus-datastore -w deploy/piraeus-operator-controller-manager
```
## Deploy Piraeus Operator v2 Using Helm
To deploy Piraeus Operator v2 using Helm, clone the latest v2 release of Piraeus. The latest releases are available
on the [release page].
To also install the necessary Custom Resource Definitions for Piraeus, set `installCRDs` to `true`.
```
$ git clone -b v2.3.0 https://github.com/piraeusdatastore/piraeus-operator.git
$ cd piraeus-operator
$ helm install piraeus-operator charts/piraeus --set installCRDs=true
```
## Deploy the Piraeus Datastore Cluster
Once the Operator is deployed, deploy the Cluster using the generated resources from [step 2](./2-collect-information.md#run-the-data-collection-script).
First, create the secret used for the LINSTOR passphrase collected at the [end of step 2](./2-collect-information.md#collect-helm-generated-secrets).
```
$ cat <<-EOF | kubectl apply -f - --server-side
apiVersion: v1
kind: Secret
metadata:
name: piraeus-op-passphrase
namespace: piraeus-datastore # Change the namespace here
data:
MASTER_PASSPHRASE: ZVRxanl1cVBscXV1ZTk1cmEwVTk5b0ptd0F4OGFmWlVPUVA0NWNnUw==
EOF
```
Then, apply the resource generated by the script from step 2:
```
$ kubectl apply -f v2-resources.yaml --server-side
linstorcluster.piraeus.io/linstorcluster created
linstorsatelliteconfiguration.piraeus.io/host-networking created
linstorsatelliteconfiguration.piraeus.io/piraeus-op-ns created
```
Now the cluster will come up, using the existing data to restore the cluster state.
## Verifying Cluster State
You can check the Cluster state by using the `linstor` command line client:
```
$ kubectl exec deploy/linstor-controller -- linstor node list
$ kubectl exec deploy/linstor-controller -- linstor storage-pool list
$ kubectl exec deploy/linstor-controller -- linstor resource list-volumes
$ kubectl exec deploy/linstor-controller -- linstor error-reports list
```
You can also provision new volumes, to verify that the cluster is operational.
[release page]: https://github.com/piraeusdatastore/piraeus-operator/releases
15 changes: 10 additions & 5 deletions docs/how-to/upgrade/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ requiring manual oversight.

Upgrading Piraeus Operator is done in four steps:

1. (Optional) Migrate the LINSTOR database to use the `k8s` backend.
2. Collect information about the current deployment.
3. Remove the Piraeus Operator v1 deployment, keeping existing volumes untouched.
4. Deploy Piraeus Operator v2 using the information gathered in step 2.
* [Step 1:] (Optional) Migrate the LINSTOR database to use the `k8s` backend.
* [Step 2:] Collect information about the current deployment.
* [Step 3:] Remove the Piraeus Operator v1 deployment, keeping existing volumes untouched.
* [Step 4:] Deploy Piraeus Operator v2 using the information gathered in step 2.

## Prerequisites

Expand All @@ -24,4 +24,9 @@ This guide assumes:
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/)
- [`helm`](https://docs.helm.sh/docs/intro/install/)
- [`jq`](https://jqlang.github.io/jq/download/)
* You are familiar with the `linstor` command line utility, specifically to very the cluster status.
* You are familiar with the `linstor` command line utility, specifically to verify the cluster state.

[Step 1:]: ./1-migrate-database.md
[Step 2:]: ./2-collect-information.md
[Step 3:]: ./3-remove-operator-v1.md
[Step 4:]: ./4-install-operator-v2.md

0 comments on commit 5b624a5

Please sign in to comment.