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 13, 2023
1 parent 21526ec commit 941a0a2
Showing 1 changed file with 94 additions and 0 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

0 comments on commit 941a0a2

Please sign in to comment.