Upgrade with helm

Description

Requirements:

  • We should be able to upgrade Everest using the helm upgrade --version=<VERSION> ... command

  • Upgrade should not be performed (fails silently) if current installation doesn’t comply with the operators compatibility matrix of the next version

  • User can customize the version service endpoint

    • For airgapped envs

    • For testing

TBD:

  • What happens when upgrade fails?

Examples:

  • TBD

Implementation details:

  • implement a new “pre-upgrade“ hook for running version checks

Attachments

6
  • 30 Dec 2024, 12:14 PM
  • 30 Dec 2024, 12:14 PM
  • 30 Dec 2024, 12:14 PM
  • 30 Dec 2024, 12:14 PM
  • 30 Dec 2024, 12:14 PM
  • 30 Dec 2024, 12:14 PM
100% Done

Activity

Show:

Manish Chawla December 30, 2024 at 12:14 PM
Edited

Upgrade from 1.3.0 to 1.4.0-rc4 using helm upgrade is successful
Install 1.3.0 and create two namespaces - a1 and a2. Install mysql in a1 and mongodb, pg in a2.

By default it will install the last release

helm install everest-core percona/everest --namespace everest-system --create-namespace --set dbNamespace.namespaceOverride=a1 --set dbNamespace.psmdb=false --set dbNamespace.postgresql=false --set server.rbac.enabled=false NAME: everest-core LAST DEPLOYED: Thu Dec 26 05:44:17 2024 NAMESPACE: everest-system STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: Thank you for installing Everest! helm list -n everest-system NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION everest-core everest-system 1 2024-12-26 05:44:17.294198707 +0000 UTC deployed everest-1.3.0 1.3.0

Create mysql databases of 1, 3, 5 nodes

Install a2 namespace

helm install everest percona/everest-db-namespace --create-namespace --namespace a2 --set pxc=false NAME: everest LAST DEPLOYED: Thu Dec 26 05:57:39 2024 NAMESPACE: a2 STATUS: deployed REVISION: 1 TEST SUITE: None helm list -n a2 NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION everest a2 1 2024-12-26 05:57:39.86144807 +0000 UTC deployed everest-db-namespace-1.3.0 1.3.0

Create mysql, mongodb databases of 3 nodes, take scheduled backups with PITR. Create pg database of 3 nodes. Run restore to same cluster and new cluster.

Upgrade to 1.4.0-rc4 using -reset-then-reuse-values

helm upgrade everest-core percona/everest --namespace everest-system --reset-then-reuse-values --set versionMetadataURL=https://check-dev.percona.com --devel --version=1.4.0-rc4 --wait

After upgrade, the everest-core is updated to 1.4.0-rc4

helm list -n everest-system NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION everest-core everest-system 2 2024-12-26 09:29:49.766645543 +0000 UTC deployed everest-1.4.0-rc4 1.4.0-rc4 helm list -n a2 NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION everest a2 1 2024-12-26 05:57:39.86144807 +0000 UTC deployed everest-db-namespace-1.3.0 1.3.0

However, the charts of the db namespace is not upgraded. We have to run upgrade of the db namespace also

helm upgrade everest percona/everest-db-namespace --namespace a2 --reset-then-reuse-values --set pxc=false --set versionMetadataURL=https://check-dev.percona.com --devel --version=1.4.0-rc4 --wait Release "everest" has been upgraded. Happy Helming! NAME: everest LAST DEPLOYED: Thu Dec 26 14:46:12 2024 NAMESPACE: a2 STATUS: deployed REVISION: 2 TEST SUITE: None helm list -n a2 NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION everest a2 2 2024-12-26 14:46:12.269901487 +0000 UTC deployed everest-db-namespace-1.4.0-rc4 1.4.0-rc4

Upgraded mongodb and pg operators, then upgraded crd of the mongodb, pg databases.

kubectl get csv -n a2 NAME DISPLAY VERSION REPLACES PHASE percona-postgresql-operator.v2.5.0 Percona Operator for PostgreSQL 2.5.0 percona-postgresql-operator.v2.4.1 Succeeded percona-server-mongodb-operator.v1.18.0 Percona Distribution for MongoDB Operator 1.18.0 percona-server-mongodb-operator.v1.17.0 Succeeded kubectl get sub -n a2 NAME PACKAGE SOURCE CHANNEL percona-postgresql-operator percona-postgresql-operator everest-catalog stable-v2 percona-server-mongodb-operator percona-server-mongodb-operator everest-catalog stable-v1 kubectl get ip -n a2 NAME CSV APPROVAL APPROVED install-4mbjv percona-postgresql-operator.v2.4.1 Manual true install-qfw7c percona-server-mongodb-operator.v1.18.0 Manual true

 

 

 

 

 

 

Tested backup and restore of databases and it worked.

Add pxc in a2 namespace.

helm upgrade everest percona/everest-db-namespace --namespace a2 --reset-then-reuse-values --set pxc=true --devel --version=1.4.0-rc4 Release "everest" has been upgraded. Happy Helming! NAME: everest LAST DEPLOYED: Thu Dec 26 15:29:53 2024 NAMESPACE: a2 STATUS: deployed REVISION: 4 TEST SUITE: None helm list -n a2 NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION everest a2 4 2024-12-26 15:29:53.778982601 +0000 UTC deployed everest-db-namespace-1.4.0-rc4 1.4.0-rc4

Create a mysql db in a2.

Install another namespace a3 with only pg operator. Create pg database.

helm install everest percona/everest-db-namespace --create-namespace --namespace a3 --set pxc=false --set psmdb=false --devel --version 1.4.0-rc4 helm list -n a3 NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION everest a3 1 2024-12-26 15:39:18.941581599 +0000 UTC deployed everest-db-namespace-1.4.0-rc4 1.4.0-rc4

Uninstall a2 namespace

helm uninstall everest -n a2 --wait --timeout=20m These resources were kept due to the resource policy: [Subscription] percona-postgresql-operator [Subscription] percona-server-mongodb-operator [Subscription] percona-xtradb-cluster-operator release "everest" uninstalled helm uninstall everest -n a3 These resources were kept due to the resource policy: [Subscription] percona-postgresql-operator release "everest" uninstalled helm uninstall everest-core -n everest-system These resources were kept due to the resource policy: [Subscription] percona-xtradb-cluster-operator release "everest-core" uninstalled kubectl get ns NAME STATUS AGE a2 Active 9h a3 Active 14m default Active 10h everest-system Active 10h kubectl delete namespace a2 kubectl delete namespace a3 kubectl delete namespace everest-system

All namespaces were deleted, a1 namespace was automatically deleted during helm uninstall of everest-core.

Note: I haven’t tested this in air gapped environments as I didn’t have an environment.

Unresolved

Details

Assignee

Reporter

Fix versions

Due date

Priority

Smart Checklist

Created September 24, 2024 at 9:39 AM
Updated January 8, 2025 at 4:58 PM

Flag notifications