# Migration to 26.0.5 Component Update 26 0 5 ## ⚠️ Breaking Changes - Helm chart dependencies switched to CloudPirates charts for PostgreSQL and RabbitMQ - PostgreSQL and RabbitMQ moved from Bitnami Legacy images to official images postgres:18.4, rabbitmq:4.3.4-management - OpenSearch upgraded to 3.8.0 ## Overview The key change in this release is a switch of the chart provider for the **PostgreSQL** and **RabbitMQ** dependencies: from `bitnami/*` (charts.bitnami.com) to **CloudPirates OCI charts** (`oci://registry-1.docker.io/cloudpirates`). **OpenSearch** stays on the same repository, only the major version changes (2.x → 3.x). ⚠️ **A chart vendor switch is NOT an in-place dependency upgrade.** The new chart uses different subchart names, persistence structures, and values layout, resulting in different PVC names. A plain `helm upgrade` will not migrate data automatically. ⚠️ **DOWNTIME IS REQUIRED.** This migration tears down the RabbitMQ and PostgreSQL releases/PVCs and rebuilds them. There is no zero-downtime path — plan a maintenance window. | Component | Before | After | Data | |---|---|---|---| | PostgreSQL | `bitnami/postgresql` 16.7.21 | `cloudpirates/postgres` (alias `postgresql`) 0.19.14, OCI | **Requires migration (dump/restore)** | | RabbitMQ | `bitnami/rabbitmq` 16.0.11 | `cloudpirates/rabbitmq` 0.21.15, OCI | No backup needed — queues are ephemeral | | OpenSearch | `opensearch-project` 2.38.0 | `opensearch-project` 3.8.0 (repo unchanged) | No backup needed | | Chart `reportportal` | 26.x.x | 26.8.12 | — | --- ## Migration Steps ### 0. Pre-checks **RabbitMQ:** confirm the reporting queues are empty (no in-flight events). ```bash kubectl exec -it -n reportportal -- rabbitmqctl list_queues name messages ``` **PostgreSQL:** dump the current Bitnami DB. ```bash kubectl get pods -n reportportal -l app.kubernetes.io/name=postgresql kubectl exec -it my-release-postgresql-0 -n reportportal -- \ bash -c "PGPASSWORD='' pg_dump -U postgres reportportal" \ > reportportal_backup_$(date +%F).sql ``` --- ### 1. ⚠️ Tear down old ReportPortal release Uninstall the old release to clean up deployments and subcharts: ```bash helm uninstall my-release -n reportportal ``` *Helm does **not** delete PVCs — old storage claims remain intact in the namespace until explicitly removed.* --- ### 2. Delete old PVCs Delete the volumes of the deprecated Bitnami and OpenSearch components to release disk space: ```bash # RabbitMQ kubectl delete pvc -n reportportal data-reportportal-my-release-rabbitmq-0 # PostgreSQL (Bitnami volume) kubectl delete pvc -n reportportal data-my-release-postgresql-0 # OpenSearch kubectl delete pvc -n reportportal data-my-release-opensearch-cluster-master-0 ``` *Confirm exact volume names with `kubectl get pvc -n reportportal` before executing.* --- ### 3. Deploy Standalone PostgreSQL & Restore Dump To prevent Liquibase race conditions (where `serviceapi` initializes an empty schema before restore), deploy CloudPirates PostgreSQL independently **first**, then restore the dump. #### Step 3.1: Install Standalone PostgreSQL Create a temporary file `postgres-standalone-values.yaml`: ```yaml image: repository: postgres tag: "18.4" auth: username: "rp_user" password: "rp_password" database: "reportportal" service: port: 5432 persistence: enabled: true size: 20Gi accessModes: - ReadWriteOnce ``` Install PostgreSQL as a standalone release: ```bash helm install rp-postgres oci://registry-1.docker.io/cloudpirates/postgres \ -n reportportal \ -f postgres-standalone-values.yaml ``` #### Step 3.2: Restore the SQL Dump Once `rp-postgres-0` is in `Running` state: ```bash kubectl exec -i rp-postgres-0 -n reportportal -- \ bash -c "PGPASSWORD='rp_password' psql -U rp_user reportportal" \ < reportportal_backup_.sql ``` Verify that tables were restored: ```bash kubectl exec -it rp-postgres-0 -n reportportal -- \ bash -c "PGPASSWORD='rp_password' psql -U rp_user -d reportportal -c '\dt' | wc -l" ``` --- ### 4. ⚠️ Safely Hand Over Volume to ReportPortal Because the volume uses `ReadWriteOnce` (RWO), you **must** ensure the standalone pod is completely terminated before starting the main ReportPortal chart. Otherwise, Kubernetes will fail with a `Multi-Attach error`. 1. Remove the standalone Helm release: ```bash helm uninstall rp-postgres -n reportportal ``` 2. **Wait for pod termination:** ```bash kubectl wait --for=delete pod/rp-postgres-0 -n reportportal --timeout=120s ``` *The PVC `data-rp-postgres-0` remains preserved in the namespace.* --- ### 5. Deploy ReportPortal 26.0.5 Now that the database contains the restored schema, deploy ReportPortal configured to attach the existing PVC. Liquibase will detect the existing database structures and automatically apply only the delta migrations (24.x/25.x → 26.x). Add/update the `postgresql` block in your ReportPortal `values.yaml`: ```yaml postgresql: install: true image: repository: postgres tag: "18.4" auth: username: *dbuser password: *dbpassword database: *dbname service: port: *dbport persistence: enabled: true size: 20Gi accessModes: - ReadWriteOnce existingClaim: "data-rp-postgres-0" # Reuses the restored PVC from Step 3 volumeName: "data" ``` Deploy ReportPortal: ```bash helm upgrade --install my-release \ -n reportportal \ reportportal/reportportal \ -f values.yaml ``` > **Future Upgrades Note:** > For all future releases, ReportPortal manages PostgreSQL seamlessly as an internal subchart (`postgresql.install=true`). The `existingClaim: "data-rp-postgres-0"` parameter keeps pointing to this volume, making all future Helm upgrades zero-toil. --- ### 6. Post-upgrade Verification & Required Steps 1. **Verify Pod Status & Logs:** ```bash kubectl get pods -n reportportal -l app.kubernetes.io/instance=my-release kubectl logs -n reportportal -l app.kubernetes.io/name=api --tail=100 ``` 2. **Verify RabbitMQ Plugins:** ```bash kubectl exec -it -n reportportal -- rabbitmqctl list_plugins ``` 3. **⚠️ Re-index OpenSearch via ReportPortal Admin UI:** Because OpenSearch was recreated with fresh, empty volumes, log patterns and historical data must be re-indexed: * Log into ReportPortal UI as an **Superadmin**. * Navigate to **Project Settings** → **Analyzer**. * Click **Generate Index** to populate OpenSearch with existing launch data from PostgreSQL.