Upgrade to 1.5.0
This document outlines the step-by-step process to be followed before upgrading Devtron to version 1.5.0.
Overview of the Upgrade Process
The upgrade process consists of three sequential Kubernetes jobs:
devtron-pre-upgrade: Prepares the environment for the upgrade.
devtron-upgrade-init: Scales down Devtron and takes the backup.
devtron-upgrade: Performs the restoration of data and scales up Devtron.
After the completion of the above jobs, you may proceed to upgrade Devtron using the UI or command line.
Prerequisites
Ensure that you have deployed the devtron-backups chart and that at least one backup has been pushed successfully. Click here to know more about the backups chart.
You must have administrative access to the cluster where Devtron is running, along with
kubectl
configured.PVC creation must not be blocked by any policy. If it is, exclude the
devtroncd
namespace from it.
Steps
1. Apply the 'pre-upgrade' job
The devtron-pre-upgrade
job creates the necessary resources and prepares for the database backup.
# Apply the devtron-pre-upgrade job
kubectl apply -f https://raw.githubusercontent.com/devtron-labs/utilities/refs/heads/main/scripts/postgres-upgrade/devtron-pre-upgrade.yaml
This job will:
Create a ConfigMap named
devtron-postgres-upgrade
in thedevtroncd
namespace.Determine the StorageClass and size of the existing PostgreSQL PVC.
Create a new PVC named
devtron-db-upgrade-pvc
with additional storage (+5Gi).Automatically apply the upgrade-init job.
To monitor the progress of this job:
kubectl logs -f job/devtron-pre-upgrade -n devtroncd
Wait for this job to complete successfully before proceeding.
2. Monitor the 'upgrade-init' job
The devtron-upgrade-init
job is automatically triggered by the devtron-pre-upgrade
job:
It scales down all Devtron components to ensure database consistency.
Terminates active database connections.
Starts the Postgres migration process.
To monitor the progress of this job:
kubectl logs -f job/devtron-upgrade-init -n devtroncd
Ensure this job completes successfully before proceeding to the next step.
3. Apply the 'upgrade' job
Once the backup is confirmed, apply the final upgrade job:
kubectl apply -f https://raw.githubusercontent.com/devtron-labs/utilities/refs/heads/main/scripts/postgres-upgrade/devtron-upgrade.yaml
This job will:
Verify if the
devtron-upgrade-init
job was successful.Extract any nodeSelectors or tolerations from the existing PostgreSQL StatefulSet.
Remove PostgreSQL 11 components.
Install PostgreSQL 14 with the same configuration.
Migrate the data.
Scale up all Devtron components.
To monitor the progress of this job:
kubectl logs -f job/devtron-upgrade -n devtroncd
Verify the Upgrade
After the upgrade job completes, verify the PostgreSQL migration:
# Check if all pods are running
kubectl get pods -n devtroncd
# Verify PostgreSQL version (should now be 14)
kubectl get configmap devtron-postgres-upgrade -n devtroncd -o jsonpath="{.data.POSTGRES_MIGRATED}"
The value of POSTGRES_MIGRATED
should be "14" if the migration was successful.
Potential Issues and Troubleshooting
Job Failure
If the
devtron-upgrade-init
or thedevtron-upgrade
job fails, check the logs of job and the ConfigMap for error messages:
kubectl get configmap devtron-postgres-upgrade -n devtroncd -o yaml
Look for any entries with "ERROR" in the keys.
To reapply the devtron-upgrade-init job, delete the PVC named
devtron-db-upgrade-pvc
, recreate it with the same configurations and then reapply thedevtron-upgrade-init
job.If the
devtron-upgrade-init
job is in a pending state, check for the PVC nameddevtron-db-upgrade-pvc
, ensure that the PVC is successfully created.
Next Steps
Once the database migration is complete, you can proceed with upgrading the Devtron application through the UI as mentioned in the final message of the upgrade job. Alternatively, you may use the upgrade commands mentioned below.
Upgrade Commands
Update the Helm repository
helm repo update
Run the upgrade command for Devtron
helm upgrade devtron devtron/devtron-operator -n devtroncd --reuse-values -f https://raw.githubusercontent.com/devtron-labs/devtron/refs/tags/v1.5.1/charts/devtron/devtron-bom.yaml --version 0.22.93
Last updated
Was this helpful?