Update Helm
Update a Helm installation by backing up the metadata database and running helm upgrade with the new chart version. The chart updates Governor and its workers together.
Read Before you update first. If you’re upgrading a release installed with a chart older than 1.153.0, also read Upgrading from agent to worker naming.
Before you start
-
Helm, set up for your cluster.
-
Access to the chart at
oci://synthesizedio.jfrog.io/helm/governor, the same chart the installation uses. -
Your
values.yaml, and the values you passed with--setat installation. If you don’t have them, runhelm get values governor -n <namespace>to see what the release uses now.
Without internet access, prepare on a connected machine:
-
Download the chart with
helm pull oci://synthesizedio.jfrog.io/helm/governor --version <chart-version>, and movegovernor-<chart-version>.tgzto where you run Helm. Use its path instead of theoci://address inhelm upgrade. -
Copy the new images,
synthesizedio/synthesized-api,synthesizedio/synthesized-frontandsynthesizedio/synthesized-worker, each tagged with the chart version, to a registry the cluster can reach. Setapi.image.repository,front.image.repositoryandworker.image.repositoryinvalues.yamlto their addresses there.
See Offline Installation for the other images the chart may need.
Update
-
Back up the metadata database. Do this before anything else.
<db-host>is the PostgreSQL server that holds Governor’s database.pg_dump -U apiuser -h <db-host> -F c -b -v -f /path/to/backup/db-backup.full.dump governor -
Upgrade the release:
helm upgrade governor oci://synthesizedio.jfrog.io/helm/governor --version <chart-version> -n <namespace> -f values.yamlgovernoris the release name used at installation, and<chart-version>is the version you move to, for example1.183.0.helm upgradedoesn’t keep the values you passed with--setat installation, such as the database credentials,JWT_SECRET,ADMIN_DEFAULT_PASSWORDandSYNTHESIZED_KEY. Pass the same--setflags again, or keep these values in a Kubernetes Secret that the chart reads throughapi.container.secretEnv. KeepJWT_SECRETandCREDENTIALS_ENCRYPTION_KEYunchanged. -
Check the update. The
governor-api,governor-frontandgovernor-workerpods should beRunning:kubectl get pods -n <namespace> kubectl logs deployment/governor-api -n <namespace>Sign in, and check that your workflows and data sources are there.
Roll back
-
Stop the API, so the new release doesn’t use the database while you restore it:
kubectl scale deployment governor-api --replicas=0 -n <namespace> -
Restore the database from the backup. Always do this: the previous release must run on the database as it was before the update. The PostgreSQL user must be allowed to drop and create databases; if
apiuserisn’t, rundropdbandcreatedbas a superuser.dropdb -U apiuser -h <db-host> governor createdb -U apiuser -h <db-host> -O apiuser governor pg_restore --exit-on-error -U apiuser -h <db-host> -d governor /path/to/backup/db-backup.full.dump -
Roll back the release to the revision before the update.
helm history governor -n <namespace>lists the revisions. The rollback also brings the API deployment back to its previous number of replicas.helm rollback governor <revision> -n <namespace> -
Check the rollback with
kubectl get pods -n <namespace>andkubectl logs deployment/governor-api -n <namespace>, then sign in.
Upgrading from agent to worker naming
Chart version 1.153.0 renamed the agent component to worker. This section applies when you upgrade a release installed with an older chart.
What the upgrade does
-
The chart renames the Kubernetes resources from
governor-agenttogovernor-worker. Helm deletes the old Deployment, ConfigMap and Secret and creates thegovernor-workerones. -
Legacy
agent:andtdkAgents:values in yourvalues.yamlstill work. The chart merges them on top of theworker:andtdkWorkers:defaults, and Helm prints deprecation warnings until you migrate your values file. -
A pre-upgrade hook looks for the legacy worker PVC:
agent-pvc, or the name you set inagent.persistence.claimName. If the PVC exists, the hook annotates it withhelm.sh/resource-policy: keep, so Helm doesn’t delete it. -
The PVC and the RocksDB data on it are kept, but the new
governor-workerpod doesn’t mount it. Unless you act, the worker starts without its existing RocksDB data. -
If the hook can’t annotate the PVC (for example, because of RBAC or an admission webhook), the upgrade stops before Helm deletes anything. The logs of the
<release-name>-agent-cleanupJob show the error and how to fix it.
The hook runs on every helm upgrade and pulls the alpine/k8s image from Docker Hub. In a cluster without internet access, set migrationCleanup.image.repository and migrationCleanup.image.tag to a copy of that image in your own registry.
Who must act
| Your setup | What to do before upgrading |
|---|---|
|
Nothing. There is no legacy PVC to keep. |
|
Mount the legacy PVC into the new worker. Add this to your
|
|
Set |
Monitoring, NetworkPolicies, ServiceMonitors or scripts refer to |
Keep the old resource names with
|
Troubleshooting
-
Read a pod’s logs with
kubectl logs <pod-name> -n <namespace>. -
If
governor-apidoesn’t start after the update, check that the database values and secrets were passed again.