### View Migration Script Output Example Source: https://piraeus.io/docs/stable/upgrade/migration/2-collect-information?q= Example output showing resource diffs and the generated v2 configuration file content. ```text Using kubectl context: kubernetes-admin@kubernetes Found LinstorControllers: ["piraeus-cs"] Found LinstorSatelliteSets: ["piraeus-ns"] Found LinstorCSIDrivers: ["piraeus"] Found additional environment variables passed to LINSTOR Controller --- Default resource +++ Updated resource @@ -143,6 +143,12 @@ kind: Deployment - args: - startController env: + - name: FOO + value: bar + - name: EXAMPLE + valueFrom: + fieldRef: + fieldPath: status.podIP - name: JAVA_OPTS value: -Djdk.tls.acknowledgeCloseNotify=true - name: K8S_AWAIT_ELECTION_ENABLED Apply the patch (Y/n)? y ... --------------------------------------------------------------------------------------------- | After upgrading, apply the following resources. They have been saved to v2-resources.yaml | --------------------------------------------------------------------------------------------- apiVersion: piraeus.io/v1 kind: LinstorCluster metadata: name: linstorcluster spec: linstorPassphraseSecret: piraeus-passphrase patches: [] ... ``` -------------------------------- ### LinstorSatelliteConfiguration - TLS Setup Source: https://piraeus.io/docs/stable/reference/linstorsatelliteconfiguration Example of setting up automatic creation of LINSTOR Satellite TLS secrets using a cert-manager issuer. ```APIDOC ## LinstorSatelliteConfiguration - TLS Setup ### Description This example sets up automatic creation of the LINSTOR Satellite TLS secrets using a cert-manager issuer named `piraeus-root`. ### Method POST ### Endpoint /websites/piraeus_io ### Request Body ```yaml apiVersion: piraeus.io/v1 kind: LinstorSatelliteConfiguration metadata: name: satellite-tls spec: internalTLS: certManager: kind: Issuer name: piraeus-root ``` ### Response #### Success Response (200) - `status` (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Install LINSTOR Affinity Controller Source: https://piraeus.io/docs/stable/how-to/linstor-affinity-controller Install the LINSTOR Affinity Controller using the Helm chart. This command deploys the controller to the 'piraeus-datastore' namespace. ```bash $ helm install linstor-affinity-controller piraeus-charts/linstor-affinity-controller ``` -------------------------------- ### Install Kernel Headers on RHEL/AlmaLinux/Rocky Linux Source: https://piraeus.io/docs/stable/how-to/install-kernel-headers?q= Install kernel development packages using the dnf package manager. ```bash $ sudo dnf install -y kernel-devel-$(uname -r) ``` ```bash $ sudo dnf install -y kernel-devel ``` -------------------------------- ### Deploy kube-prometheus-stack Source: https://piraeus.io/docs/stable/how-to/monitoring Installs the Prometheus stack with configurations to ensure monitoring rules are discovered across all namespaces. ```bash $ helm install --create-namespace -n monitoring prometheus prometheus-community/kube-prometheus-stack \ --set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \ --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \ --set prometheus.prometheusSpec.ruleSelectorNilUsesHelmValues=false ``` -------------------------------- ### Install Kernel Headers on Ubuntu Source: https://piraeus.io/docs/stable/how-to/install-kernel-headers?q= Install headers for the current kernel or the virtual package to ensure headers are updated with the kernel. ```bash $ sudo apt-get update $ sudo apt-get install -y linux-headers-$(uname -r) ``` ```bash $ sudo apt-get update $ sudo apt-get install -y linux-headers-virtual ``` -------------------------------- ### Clone Piraeus Operator v2 and Install using Helm Source: https://piraeus.io/docs/stable/upgrade/migration/4-install-operator-v2 Clone the Piraeus Operator v2 repository and install it using Helm. Set installCRDs to true to include necessary Custom Resource Definitions. ```bash $ 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 ``` -------------------------------- ### Install Kernel Headers on Debian Source: https://piraeus.io/docs/stable/how-to/install-kernel-headers?q= Install headers for the current kernel or the architecture-specific package to ensure headers are updated with the kernel. ```bash $ sudo apt-get update $ sudo apt-get install -y linux-headers-$(uname -r) ``` ```bash $ sudo apt-get update $ sudo apt-get install -y linux-headers-$(dpkg --print-architecture) ``` -------------------------------- ### Install Piraeus Operator Source: https://piraeus.io/docs/stable/tutorial/get-started Install Piraeus Operator using kubectl and Kustomize. This command applies the operator resources from a remote manifest. ```bash $ kubectl apply --server-side -f "https://github.com/piraeusdatastore/piraeus-operator/releases/latest/download/manifest.yaml" namespace/piraeus-datastore configured ... ``` -------------------------------- ### Upgrade Piraeus using Helm Source: https://piraeus.io/docs/stable/upgrade Execute this Helm command to upgrade the Piraeus installation. Ensure you provide any necessary override values. ```bash helm upgrade piraeus-op ./charts/piraeus -f ``` -------------------------------- ### Deploy Piraeus Datastore with Helm Source: https://piraeus.io/docs/stable/how-to/helm After deploying the operator, use this command to install or upgrade the Piraeus Datastore cluster. This command deploys the LinstorCluster resource and related components. ```bash helm upgrade --install --namespace piraeus-datastore linstor-cluster oci://ghcr.io/piraeusdatastore/helm-charts/linstor-cluster ``` -------------------------------- ### Troubleshoot Helm Upgrade Failure Source: https://piraeus.io/docs/stable/upgrade?q= Example error message encountered during failed Helm upgrades between v0.* versions. ```text UPGRADE FAILED: cannot patch "piraeus-op-cs" with kind LinstorController: LinstorController.piraeus.linbit.com "piraeus-op-cs" is invalid: spec.etcdURL: Required value ``` -------------------------------- ### Verify Deployment and Volume Binding Source: https://piraeus.io/docs/stable/tutorial/get-started?q= Waits for the pod to become ready and confirms the PVC status has transitioned to Bound. ```bash $ kubectl wait pod --for=condition=Ready -l app.kubernetes.io/name=web-server pod/web-server-84867b5449-hgdzx condition met $ kubectl get persistentvolumeclaim NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE data-volume Bound pvc-9e1149e7-33db-47a7-8fc6-172514422143 1Gi RWO piraeus-storage 1m ``` -------------------------------- ### Wait for Pod Ready Source: https://piraeus.io/docs/stable/tutorial/get-started Wait for the web server Pod to become ready before proceeding. ```bash kubectl wait pod --for=condition=Ready -l app.kubernetes.io/name=web-server ``` -------------------------------- ### Create StorageClass, PVC, and Deployment Source: https://piraeus.io/docs/stable/tutorial/snapshots Define the infrastructure and workload required to test volume snapshots. ```yaml $ kubectl apply -f - <> /volume/hello # We use this to keep the Pod running tail -f /dev/null env: - name: NODENAME valueFrom: fieldRef: fieldPath: spec.nodeName volumeMounts: - mountPath: /volume name: data-volume volumes: - name: data-volume persistentVolumeClaim: claimName: data-volume EOF ``` -------------------------------- ### Verify Workload Status and Data Source: https://piraeus.io/docs/stable/tutorial/snapshots Wait for the deployment to become ready and inspect the logged data on the volume. ```bash $ kubectl wait pod --for=condition=Ready -l app.kubernetes.io/name=volume-logger pod/volume-logger-cbcd897b7-jrmks condition met $ kubectl exec deploy/volume-logger -- cat /volume/hello Hello from volume-logger-cbcd897b7-jrmks, running on n3.example.com, started at Mon Feb 13 15:32:46 UTC 2023 ``` -------------------------------- ### Create Web Server Deployment Source: https://piraeus.io/docs/stable/tutorial/get-started Deploy a simple Nginx web server that mounts the PersistentVolumeClaim. This demonstrates a consumer using the provisioned storage. ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: web-server spec: selector: matchLabels: app.kubernetes.io/name: web-server template: metadata: labels: app.kubernetes.io/name: web-server spec: containers: - name: web-server image: nginx volumeMounts: - mountPath: /usr/share/nginx/html name: data volumes: - name: data persistentVolumeClaim: claimName: data-volume ``` -------------------------------- ### Install or Upgrade Piraeus Operator with Helm Source: https://piraeus.io/docs/stable/how-to/helm Use this command to install or upgrade the Piraeus Operator and its CRDs in a specified namespace. The `--wait` flag ensures the command waits for resources to be ready. ```bash helm upgrade --install --create-namespace --namespace piraeus-datastore piraeus-operator oci://ghcr.io/piraeusdatastore/piraeus-operator/piraeus --set installCRDs=true --wait ``` -------------------------------- ### Apply Piraeus Monitoring Resources Source: https://piraeus.io/docs/stable/how-to/monitoring Applies monitoring and alerting resources for Piraeus Datastore using a remote Kustomize base. ```bash $ kubectl apply --server-side -n piraeus-datastore -k "https://github.com/piraeusdatastore/piraeus-operator//config/extras/monitoring?ref=v2" ``` -------------------------------- ### Deploy Piraeus Operator Source: https://piraeus.io/docs/stable/how-to/helm?q= Installs or upgrades the Piraeus Operator in the piraeus-datastore namespace with CRDs enabled. ```bash helm upgrade --install --create-namespace --namespace piraeus-datastore piraeus-operator oci://ghcr.io/piraeusdatastore/piraeus-operator/piraeus --set installCRDs=true --wait ``` -------------------------------- ### Wait for Piraeus Datastore to be Ready Source: https://piraeus.io/docs/stable/tutorial/get-started?q= Wait until all Piraeus Datastore pods are in a Ready state. This confirms that the datastore components are successfully deployed and running. ```bash $ kubectl wait pod --for=condition=Ready -n piraeus-datastore -l app.kubernetes.io/name=piraeus-datastore ``` -------------------------------- ### Check Piraeus Operator Version Source: https://piraeus.io/docs/stable/how-to/drbd-tls Verify the installed version of the Piraeus Operator using kubectl. ```bash $ kubectl get pods -l app.kubernetes.io/component=piraeus-operator -ojsonpath='{.items[*].spec.containers[?(@.name=="manager")].image}{"\n"}' quay.io/piraeusdatastore/piraeus-operator:v2.3.0 ``` -------------------------------- ### Wait for Piraeus Datastore to be Ready Source: https://piraeus.io/docs/stable/tutorial/get-started Wait until all Piraeus Datastore pods are in a 'Ready' condition. This confirms that the datastore services are operational. ```bash $ kubectl wait pod --for=condition=Ready -n piraeus-datastore -l app.kubernetes.io/name=piraeus-datastore pod/linstor-controller-65cbbc74db-9vm9n condition met pod/linstor-csi-controller-5ccb7d84cd-tvd9h condition met pod/linstor-csi-node-2lkpd condition met pod/linstor-csi-node-hbcvv condition met pod/linstor-csi-node-hmrd7 condition met pod/n1.example.com condition met pod/n2.example.com condition met pod/n3.example.com condition met pod/piraeus-operator-controller-manager-dd898f48c-bhbtv condition met ``` -------------------------------- ### Check SecureBoot Status Source: https://piraeus.io/docs/stable/how-to/secure-boot?q= Verify if SecureBoot is enabled on a Kubernetes node. This is a prerequisite for following the guide. ```bash # mokutil --sb-state SecureBoot enabled ``` -------------------------------- ### Deploy a Web Server Pod Source: https://piraeus.io/docs/stable/tutorial/get-started?q= Creates a deployment that mounts the PersistentVolumeClaim to an Nginx container. ```bash $ kubectl apply -f - <> /volume/hello # We use this to keep the Pod running tail -f /dev/null env: - name: NODENAME valueFrom: fieldRef: fieldPath: spec.nodeName volumeMounts: - mountPath: /volume name: data-volume volumes: - name: data-volume persistentVolumeClaim: claimName: data-volume ``` -------------------------------- ### Upgrade Piraeus via kubectl Source: https://piraeus.io/docs/stable/upgrade?q= Apply the latest manifest and wait for the operator pods to become ready. ```bash $ kubectl apply --server-side -f "https://github.com/piraeusdatastore/piraeus-operator/releases/latest/download/manifest.yaml" $ kubectl wait pod --for=condition=Ready -n piraeus-datastore --all ``` -------------------------------- ### DRBD build error output Source: https://piraeus.io/docs/stable/how-to/raspian?q= Example of the error message encountered when the DRBD module loader fails to find kernel header scripts on Raspberry Pi OS. ```text make[2]: *** No rule to make target '/usr/src/linux-headers-6.6.51+rpt-common-rpi/scripts/Makefile.extrawarn'. Stop. make[1]: *** [Makefile:236: compat.h] Error 2 make: *** [Makefile:131: module] Error 2 ``` -------------------------------- ### Manually Provisioned TLS Secrets for LinstorCluster Source: https://piraeus.io/docs/stable/reference/linstorcluster?q= This example shows how to create Kubernetes Secrets for TLS certificates and reference them in the LinstorCluster configuration. It uses the same secret for all clients of the LINSTOR API. ```yaml --- apiVersion: v1 kind: Secret metadata: name: my-linstor-api-tls namespace: piraeus-datastore data: ca.crt: LS0tLS1CRUdJT... tls.crt: LS0tLS1CRUdJT... tls.key: LS0tLS1CRUdJT... --- apiVersion: v1 kind: Secret metadata: name: my-linstor-client-tls namespace: piraeus-datastore data: ca.crt: LS0tLS1CRUdJT... tls.crt: LS0tLS1CRUdJT... tls.key: LS0tLS1CRUdJT... --- apiVersion: piraeus.io/v1 kind: LinstorCluster metadata: name: linstorcluster spec: apiTLS: apiSecretName: my-linstor-api-tls clientSecretName: my-linstor-client-tls csiControllerSecretName: my-linstor-client-tls csiNodeSecretName: my-linstor-client-tls affinityControllerSecretName: my-linstor-client-tls nfsServerSecretName: my-linstor-client-tls ``` -------------------------------- ### Wait for Pod and Verify Logged Data Source: https://piraeus.io/docs/stable/tutorial/snapshots?q= Wait for the 'volume-logger' pod to become ready and then execute a command to read the logged data from the volume. This confirms the workload is running and writing to the volume. ```bash $ kubectl wait pod --for=condition=Ready -l app.kubernetes.io/name=volume-logger pod/volume-logger-cbcd897b7-jrmks condition met $ kubectl exec deploy/volume-logger -- cat /volume/hello Hello from volume-logger-cbcd897b7-jrmks, running on n3.example.com, started at Mon Feb 13 15:32:46 UTC 2023 ``` -------------------------------- ### Deploy Snapshot Controller Source: https://piraeus.io/docs/stable/tutorial/snapshots?q= Deploy the snapshot controller using kubectl apply with the provided manifest URLs. This is necessary if the controller is not already deployed. ```bash kubectl apply -k https://github.com/kubernetes-csi/external-snapshotter//client/config/crd kubectl apply -k https://github.com/kubernetes-csi/external-snapshotter//deploy/kubernetes/snapshot-controller ``` -------------------------------- ### Get LINSTOR Controller Deployment Details Source: https://piraeus.io/docs/stable/upgrade/migration/1-migrate-database Retrieves the LINSTOR controller image, configuration ConfigMap name, and service account name from its deployment definition. These are needed for creating the migration pod. ```bash $ kubectl get deploy/piraeus-op-cs-controller --output=jsonpath='IMAGE={$.spec.template.spec.containers[?(@.name=="linstor-controller")].image}{"\n"}CONFIG_MAP={$.spec.template.spec.volumes[?(@.name=="linstor-conf")].configMap.name}{"\n"}SERVICE_ACCOUNT={$.spec.template.spec.serviceAccountName}{"\n"}' IMAGE=quay.io/piraeusdatastore/piraeus-server:v1.24.2 CONFIG_MAP=piraeus-op-cs-controller-config SERVICE_ACCOUNT=linstor-controller ``` -------------------------------- ### Apply Piraeus Datastore Cluster Resources Source: https://piraeus.io/docs/stable/upgrade/migration/4-install-operator-v2 Apply the generated resources to deploy the Piraeus Datastore Cluster. This command creates the necessary Piraeus and Linstor custom resources. ```bash $ 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 ``` -------------------------------- ### Automatic TLS Secret Creation with Cert-Manager for LinstorCluster Source: https://piraeus.io/docs/stable/reference/linstorcluster?q= This example configures automatic creation of LINSTOR API and Client TLS secrets using a cert-manager issuer. Certificates are validated against the certificate in the `trust-root` Secret. ```yaml apiVersion: piraeus.io/v1 kind: LinstorCluster metadata: name: linstorcluster spec: apiTLS: certManager: kind: Issuer name: piraeus-root caReference: name: trust-root kind: Secret key: root.crt ``` -------------------------------- ### Override Images using YAML Documents Source: https://piraeus.io/docs/stable/explanation/image-configuration?q= Add a YAML document (e.g., `1_override.yaml`) to the `piraeus-operator-image-config` ConfigMap to override specific component images and their tags or digests. Ensure the filename starts with a number higher than existing configuration files to guarantee it's applied last. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: piraeus-operator-image-config data: 0_piraeus_datastore_images.yaml: | # ... 0_sig_storage_images.yaml: | # ... 1_override.yaml: | --- base: quay.io/piraeusdatastore components: linstor-controller: image: piraeus-server tag: v1.31.1 linstor-satellite: image: piraeus-server digest: sha256:8bc7fd45545744864633371161e6fcd6bcaea1e7a21fb053588f970b9f912b07 ``` -------------------------------- ### Run the Migration Data Collection Script Source: https://piraeus.io/docs/stable/upgrade/migration/2-collect-information?q= Executes the migration script directly from the Piraeus documentation URL to gather cluster configuration. ```bash $ curl --proto '=https' --tlsv1.2 -sSf \ https://piraeus.io/docs/v2/how-to/upgrade/collect-operator-v1-information.sh \ | bash -s ``` -------------------------------- ### Retrieve migration pod configuration Source: https://piraeus.io/docs/stable/upgrade/migration/1-migrate-database?q= Extract image, ConfigMap, and service account details from the existing controller deployment. ```bash $ kubectl get deploy/piraeus-op-cs-controller --output=jsonpath='IMAGE={$.spec.template.spec.containers[?(@.name=="linstor-controller")].image}{"\n"}CONFIG_MAP={$.spec.template.spec.volumes[?(@.name=="linstor-conf")].configMap.name}{"\n"}SERVICE_ACCOUNT={$.spec.template.spec.serviceAccountName}{"\n"}' IMAGE=quay.io/piraeusdatastore/piraeus-server:v1.24.2 CONFIG_MAP=piraeus-op-cs-controller-config SERVICE_ACCOUNT=linstor-controller ``` -------------------------------- ### Verify restored volume content Source: https://piraeus.io/docs/stable/tutorial/snapshots?q= Wait for the pod to become ready and inspect the file contents to confirm successful restoration. ```bash $ kubectl wait pod --for=condition=Ready -l app.kubernetes.io/name=volume-logger pod/volume-logger-cbcd897b7-5qjbz condition met $ kubectl exec deploy/volume-logger -- cat /volume/hello Hello from volume-logger-cbcd897b7-jrmks, running on n3.example.com, started at Mon Feb 13 15:32:46 UTC 2023 Hello from volume-logger-cbcd897b7-gr6hh, running on n3.example.com, started at Mon Feb 13 15:42:17 UTC 2023 ``` -------------------------------- ### Verify Storage Pool Configuration Source: https://piraeus.io/docs/stable/tutorial/get-started?q= Once nodes are back online, use this command to verify that the storage pools have been successfully configured. ```bash $ kubectl -n piraeus-datastore exec deploy/linstor-controller -- linstor storage-pool list ``` -------------------------------- ### Verify Volume Placement and Status Source: https://piraeus.io/docs/stable/tutorial/replicated-volumes Check the status of the Pod and PersistentVolumeClaim, and list LINSTOR volumes to confirm replication across nodes. ```bash kubectl wait pod --for=condition=Ready -l app.kubernetes.io/name=volume-logger ``` ```bash kubectl get persistentvolumeclaim ``` ```bash kubectl -n piraeus-datastore exec deploy/linstor-controller -- linstor resource list-volumes ``` -------------------------------- ### Define migration Pod manifest Source: https://piraeus.io/docs/stable/upgrade/migration/1-migrate-database?q= Create a temporary Pod to run the linstor-database migration tool. ```yaml apiVersion: v1 kind: Pod metadata: name: linstor-database-migration spec: serviceAccountName: $SERVICE_ACCOUNT containers: - name: backup image: $IMAGE command: - /bin/bash - -c - "sleep infinity" volumeMounts: - name: linstor-conf mountPath: /etc/linstor readOnly: true - name: backup mountPath: /backup - name: logs mountPath: /logs volumes: - name: backup emptyDir: {} - name: logs emptyDir: {} - name: linstor-conf configMap: name: $CONFIG_MAP ``` -------------------------------- ### Scale up deployment Source: https://piraeus.io/docs/stable/tutorial/snapshots?q= Restore the deployment to its original replica count to begin using the new volume. ```bash $ kubectl scale deploy/volume-logger --replicas=1 deployment.apps/volume-logger scaled ``` -------------------------------- ### Show Datastore Values Source: https://piraeus.io/docs/stable/how-to/helm?q= Displays the configurable values for the Linstor cluster Helm chart. ```bash helm show values oci://ghcr.io/piraeusdatastore/helm-charts/linstor-cluster ``` -------------------------------- ### Verify External Controller Configuration Source: https://piraeus.io/docs/stable/how-to/external-controller Commands to verify the LinstorCluster status, CSI controller environment variables, and node registration. ```bash $ kubectl get LinstorCluster -ojsonpath='{.items[].status.conditions[?(@.type=="Available")].message}{"\n"}' Controller 1.20.3 (API: 1.16.0, Git: 8d19a891df018f6e3d40538d809904f024bfe361) reachable at 'http://linstor-controller.example.com:3370' ``` ```bash $ kubectl get -n piraeus-datastore deployment linstor-csi-controller -ojsonpath='{.spec.template.spec.containers[?(@.name=="linstor-csi")].env[?(@.name=="LS_CONTROLLERS")].value}{"\n"}' http://linstor-controller.example.com:3370 ``` ```bash $ kubectl get -n piraeus-datastore daemonset linstor-csi-node -ojsonpath='{.spec.template.spec.containers[?(@.name=="linstor-csi")].env[?(@.name=="LS_CONTROLLERS")].value}{"\n"}' http://linstor-controller.example.com:3370 ``` ```bash $ kubectl get nodes -owide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME k8s-1-26-10.test Ready control-plane 22m v1.26.3 192.168.122.10 AlmaLinux 9.1 (Lime Lynx) 5.14.0-162.22.2.el9_1.x86_64 containerd://1.6.20 ... $ linstor node list ╭─────────────────────────────────────────────────────────────────────╮ ┊ Node ┊ NodeType ┊ Addresses ┊ State ┊ ╞═════════════════════════════════════════════════════════════════════╡ ┊ k8s-1-26-10.test ┊ SATELLITE ┊ 192.168.122.10:3366 (PLAIN) ┊ Online ┊ ... ``` -------------------------------- ### Create LINSTOR Database Backup Source: https://piraeus.io/docs/stable/upgrade/migration/1-migrate-database Use the `linstor-database` tool within the migration Pod to export the current database to a JSON backup file. Ensure the backup file is copied to permanent storage. ```bash $ kubectl exec linstor-database-migration -- /usr/share/linstor-server/bin/linstor-database export-db -c /etc/linstor /backup/backup-before-migration.json Loading configuration file "/etc/linstor/linstor.toml" 15:22:55.684 [main] INFO LINSTOR/linstor-db -- SYSTEM - ErrorReporter DB first time init. 15:22:55.685 [main] INFO LINSTOR/linstor-db -- SYSTEM - Log directory set to: './logs' 15:22:56.417 [main] INFO LINSTOR/linstor-db -- SYSTEM - Attempting dynamic load of extension module "com.linbit.linstor.modularcrypto.FipsCryptoModule" 15:22:56.418 [main] INFO LINSTOR/linstor-db -- SYSTEM - Extension module "com.linbit.linstor.modularcrypto.FipsCryptoModule" is not installed 15:22:56.418 [main] INFO LINSTOR/linstor-db -- SYSTEM - Attempting dynamic load of extension module "com.linbit.linstor.modularcrypto.JclCryptoModule" 15:22:56.426 [main] INFO LINSTOR/linstor-db -- SYSTEM - Dynamic load of extension module "com.linbit.linstor.modularcrypto.JclCryptoModule" was successful 15:22:56.427 [main] INFO LINSTOR/linstor-db -- SYSTEM - Attempting dynamic load of extension module "com.linbit.linstor.spacetracking.ControllerSpaceTrackingModule" 15:22:56.429 [main] INFO LINSTOR/linstor-db -- SYSTEM - Dynamic load of extension module "com.linbit.linstor.spacetracking.ControllerSpaceTrackingModule" was successful 15:22:57.666 [main] INFO LINSTOR/linstor-db -- SYSTEM - Initializing the etcd database 15:22:57.667 [main] INFO LINSTOR/linstor-db -- SYSTEM - etcd connection URL is "etcd://piraeus-op-etcd:2379" 15:22:59.480 [main] INFO LINSTOR/linstor-db -- SYSTEM - Export finished ``` ```bash $ kubectl cp linstor-database-migration:/backup/backup-before-migration.json backup-before-migration.json ``` -------------------------------- ### Copy Database Backup to Permanent Storage Source: https://piraeus.io/docs/stable/upgrade/migration/1-migrate-database?q= After creating the backup within the Pod, use `kubectl cp` to copy the backup file to your local filesystem. This ensures the backup is not lost if the migration Pod is restarted. ```bash $ kubectl cp linstor-database-migration:/backup/backup-before-migration.json backup-before-migration.json ``` -------------------------------- ### Deploy Piraeus Operator v2 using kubectl Source: https://piraeus.io/docs/stable/upgrade/migration/4-install-operator-v2 Apply the kustomization.yaml file to deploy the Piraeus Operator using kubectl. This command initiates the deployment and waits for it to complete. ```bash $ kubectl apply -k . --server-side $ kubectl rollout status -n piraeus-datastore -w deploy/piraeus-operator-controller-manager ``` -------------------------------- ### Restart LINSTOR deployments Source: https://piraeus.io/docs/stable/how-to/restore-linstor-db Scale the deployments back to one replica and verify the rollout status. ```bash $ kubectl scale deployment piraeus-operator-controller-manager --replicas 1 deployment.apps/piraeus-operator-controller-manager scaled $ kubectl scale deployment linstor-controller --replicas 1 deployment.apps/linstor-controller scaled $ kubectl rollout status deployment piraeus-operator-controller-manager Waiting for deployment "piraeus-operator-controller-manager" rollout to finish: 0 of 1 updated replicas are available... deployment "piraeus-operator-controller-manager" successfully rolled out $ kubectl rollout status deployment linstor-controller Waiting for deployment "linstor-controller" rollout to finish: 0 of 1 updated replicas are available... deployment "linstor-controller" successfully rolled out ``` -------------------------------- ### Extract and restore database Source: https://piraeus.io/docs/stable/how-to/restore-linstor-db Unpack the backup archive and apply the resources to the cluster to replace the current database. ```bash $ mkdir restore $ cd restore # Replace $BACKUP_NAME with your selected backup name $ kubectl get secrets --sort-by=.metadata.name -l piraeus.io/backup=$BACKUP_NAME -ogo-template='{{range .items}}{{index .data "backup.tar.gz" | base64decode}}{{end}}' > backup.tar.gz $ tar -xvf backup.tar.gz crds.yaml [...] ``` ```bash $ kubectl api-resources --api-group=internal.linstor.linbit.com -oname | xargs --no-run-if-empty kubectl delete crds $ kubectl create -f . ``` -------------------------------- ### Import Signing Certificate to Machine Trust Store Source: https://piraeus.io/docs/stable/how-to/secure-boot?q= Import the generated signing certificate into the machine owner keys (MOK) using mokutil. A password will be required during the import process and later for enrollment. ```bash # mokutil --import signing_key.x509 input password: input password again: ``` -------------------------------- ### Restart Deployment and Verify Pod Migration Source: https://piraeus.io/docs/stable/tutorial/replicated-volumes Trigger a rollout restart for a deployment and wait for the pod to become ready on a different node. This demonstrates automatic rescheduling. ```bash $ kubectl rollout restart deploy/volume-logger deployment.apps/volume-logger restarted $ kubectl wait pod --for=condition=Ready -l app.kubernetes.io/name=volume-logger pod/volume-logger-5db9dd7b87-lps2f condition met $ kubectl get pods -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES volume-logger-5db9dd7b87-lps2f 1/1 Running 0 26s 10.125.97.9 n2.example.com ``` -------------------------------- ### Deploy Piraeus Datastore Source: https://piraeus.io/docs/stable/how-to/helm?q= Creates the Linstor cluster deployment within the piraeus-datastore namespace. ```bash helm upgrade --install --namespace piraeus-datastore linstor-cluster oci://ghcr.io/piraeusdatastore/helm-charts/linstor-cluster ``` -------------------------------- ### Deploy Snapshot Controller Source: https://piraeus.io/docs/stable/tutorial/snapshots Apply the necessary CRDs and controller manifests if the snapshot API is not present. ```bash kubectl apply -k https://github.com/kubernetes-csi/external-snapshotter//client/config/crd kubectl apply -k https://github.com/kubernetes-csi/external-snapshotter//deploy/kubernetes/snapshot-controller ``` -------------------------------- ### Deploy a Workload with Replicated Storage Source: https://piraeus.io/docs/stable/tutorial/replicated-volumes?q= Creates a deployment that mounts the replicated volume and logs node information to a file. ```yaml $ kubectl apply -f - <> /volume/hello # We use this to keep the Pod running tail -f /dev/null env: - name: NODENAME valueFrom: fieldRef: fieldPath: spec.nodeName volumeMounts: - mountPath: /volume name: replicated-volume volumes: - name: replicated-volume persistentVolumeClaim: claimName: replicated-volume EOF ``` -------------------------------- ### Create LINSTOR Database Backup Source: https://piraeus.io/docs/stable/upgrade/migration/1-migrate-database?q= Use the `linstor-database export-db` command within the migration Pod to create a backup of the current database. This backup is essential before proceeding with any configuration changes. ```bash $ kubectl exec linstor-database-migration -- /usr/share/linstor-server/bin/linstor-database export-db -c /etc/linstor /backup/backup-before-migration.json Loading configuration file "/etc/linstor/linstor.toml" 15:22:55.684 [main] INFO LINSTOR/linstor-db -- SYSTEM - ErrorReporter DB first time init. 15:22:55.685 [main] INFO LINSTOR/linstor-db -- SYSTEM - Log directory set to: './logs' 15:22:56.417 [main] INFO LINSTOR/linstor-db -- SYSTEM - Attempting dynamic load of extension module "com.linbit.linstor.modularcrypto.FipsCryptoModule" 15:22:56.418 [main] INFO LINSTOR/linstor-db -- SYSTEM - Extension module "com.linbit.linstor.modularcrypto.FipsCryptoModule" is not installed 15:22:56.418 [main] INFO LINSTOR/linstor-db -- SYSTEM - Attempting dynamic load of extension module "com.linbit.linstor.modularcrypto.JclCryptoModule" 15:22:56.426 [main] INFO LINSTOR/linstor-db -- SYSTEM - Dynamic load of extension module "com.linbit.linstor.modularcrypto.JclCryptoModule" was successful 15:22:56.427 [main] INFO LINSTOR/linstor-db -- SYSTEM - Attempting dynamic load of extension module "com.linbit.linstor.spacetracking.ControllerSpaceTrackingModule" 15:22:56.429 [main] INFO LINSTOR/linstor-db -- SYSTEM - Dynamic load of extension module "com.linbit.linstor.spacetracking.ControllerSpaceTrackingModule" was successful 15:22:57.666 [main] INFO LINSTOR/linstor-db -- SYSTEM - Initializing the etcd database 15:22:57.667 [main] INFO LINSTOR/linstor-db -- SYSTEM - etcd connection URL is "etcd://piraeus-op-etcd:2379" 15:22:59.480 [main] INFO LINSTOR/linstor-db -- SYSTEM - Export finished ``` -------------------------------- ### Verify LINSTOR Configuration Update Source: https://piraeus.io/docs/stable/upgrade/migration/1-migrate-database?q= Check the LINSTOR configuration file within the migration Pod to confirm that the `dbConnectionURL` has been updated to the new backend (e.g., 'k8s'). This may take some time to propagate. ```bash $ kubectl exec linstor-database-migration -- cat /etc/linstor/linstor.toml [db] connection_url = "k8s" ``` -------------------------------- ### Create LinstorSatelliteConfiguration Source: https://piraeus.io/docs/stable/tutorial/get-started Apply this YAML to create a LinstorSatelliteConfiguration resource, defining a file-based thin storage pool named 'pool1' on each node. This resource does not require additional host configuration. ```yaml apiVersion: piraeus.io/v1 kind: LinstorSatelliteConfiguration metadata: name: storage-pool spec: storagePools: - name: pool1 fileThinPool: directory: /var/lib/piraeus-datastore/pool1 ``` -------------------------------- ### Check Kernel TLS Session Statistics Source: https://piraeus.io/docs/stable/how-to/drbd-tls?q= Execute this command on each node to inspect the kernel's TLS session statistics. Verify that TlsRxSw and TlsTxSw are equal and non-zero. If TLS offloading is supported by the network card, TlsTxDevice and TlsRxDevice might be non-zero instead. ```bash $ kubectl exec node1.example.com -- cat /proc/net/tls_stat TlsCurrTxSw 4 TlsCurrRxSw 4 TlsCurrTxDevice 0 TlsCurrRxDevice 0 TlsTxSw 4 TlsRxSw 4 TlsTxDevice 0 TlsRxDevice 0 TlsDecryptError 0 TlsRxDeviceResync 0 TlsDecryptRetry 0 TlsRxNoPadViolation 0 ```