This documentation is available to agents as Markdown at https://docs.synthesized.io/tdk/latest/user_guide/050_deployment_operations/updating_tdk/update_helm.md. For the complete documentation index, see llms.txt.

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 --set at installation. If you don’t have them, run helm get values governor -n <namespace> to see what the release uses now.

Without internet access, prepare on a connected machine:

  1. Download the chart with helm pull oci://synthesizedio.jfrog.io/helm/governor --version <chart-version>, and move governor-<chart-version>.tgz to where you run Helm. Use its path instead of the oci:// address in helm upgrade.

  2. Copy the new images, synthesizedio/synthesized-api, synthesizedio/synthesized-front and synthesizedio/synthesized-worker, each tagged with the chart version, to a registry the cluster can reach. Set api.image.repository, front.image.repository and worker.image.repository in values.yaml to their addresses there.

See Offline Installation for the other images the chart may need.

Update

  1. 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
  2. Upgrade the release:

    helm upgrade governor oci://synthesizedio.jfrog.io/helm/governor --version <chart-version> -n <namespace> -f values.yaml

    governor is the release name used at installation, and <chart-version> is the version you move to, for example 1.183.0.

    helm upgrade doesn’t keep the values you passed with --set at installation, such as the database credentials, JWT_SECRET, ADMIN_DEFAULT_PASSWORD and SYNTHESIZED_KEY. Pass the same --set flags again, or keep these values in a Kubernetes Secret that the chart reads through api.container.secretEnv. Keep JWT_SECRET and CREDENTIALS_ENCRYPTION_KEY unchanged.
  3. Check the update. The governor-api, governor-front and governor-worker pods should be Running:

    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

  1. 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>
  2. 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 apiuser isn’t, run dropdb and createdb as 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
  3. 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>
  4. Check the rollback with kubectl get pods -n <namespace> and kubectl 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-agent to governor-worker. Helm deletes the old Deployment, ConfigMap and Secret and creates the governor-worker ones.

  • Legacy agent: and tdkAgents: values in your values.yaml still work. The chart merges them on top of the worker: and tdkWorkers: 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 in agent.persistence.claimName. If the PVC exists, the hook annotates it with helm.sh/resource-policy: keep, so Helm doesn’t delete it.

  • The PVC and the RocksDB data on it are kept, but the new governor-worker pod 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-cleanup Job 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

agent.persistence was not enabled

Nothing. There is no legacy PVC to keep.

agent.persistence.enabled: true, and you want to keep the worker’s RocksDB data

Mount the legacy PVC into the new worker. Add this to your values.yaml (use your own claim name if you set agent.persistence.claimName):

worker:
  persistence:
    enabled: true
    claimName: agent-pvc
    name: worker-pv
    mountPath: /app/rocksdb

agent.persistence.enabled: true, and you don’t need the worker’s RocksDB data

Set migrationCleanup.deleteLegacyPvc: true. The hook skips the annotation, and Helm deletes the PVC and its data during the upgrade.

Monitoring, NetworkPolicies, ServiceMonitors or scripts refer to governor-agent by name

Keep the old resource names with agent.name: governor-agent. If you also use persistence, set agent.persistence.claimName: agent-pvc so that the worker keeps the same PVC:

agent:
  name: governor-agent
  persistence:
    enabled: true
    claimName: agent-pvc

Migrating your values file

When you’re ready to adopt the new naming:

  1. Rename agent: to worker:. The structure is the same.

  2. Rename tdkAgents: to tdkWorkers:, if you have it.

  3. Don’t keep both agent: and worker: blocks: agent: values win on conflict, which can be confusing.

Troubleshooting

  • Read a pod’s logs with kubectl logs <pod-name> -n <namespace>.

  • If governor-api doesn’t start after the update, check that the database values and secrets were passed again.