Cut over to the Emergent Supabase chart
ADR-0071 places Auth, Storage and optional Studio/Meta in infra/charts/supabase, and the Bun API in the Emergent chart as services.api. The API’s internal address becomes http://emergent-api; its public prefix stays /functions/v1. This procedure is the maintainer’s coordinated cutover of the existing supabase and emergent releases. Expect an application outage while the workloads are replaced.
Preparation
Section titled “Preparation”Run the repository validation gate before scheduling the cutover. Review the machine-specific Helmfile values alongside the tracked dev values. API environment overrides now use a map keyed by variable name, so a local override can supply one variable. The chart and the self-contained key utility in tools/scripts/generate-supabase-auth-keys.ts are available from this checkout.
Take a recoverable database backup and retain the deployed image versions before upgrading Auth or Storage. Their startup migrations can change service-owned schemas. Retain the existing Garage bucket and credentials, supabase-jwt, supabase-meta-crypto, database credentials and supabase-studio-snippets PVC. The new chart retains the snippets claim’s name and adds helm.sh/resource-policy: keep. Keep the two Helm releases installed so Helm can reconcile their previously owned resources.
From the repository root, load the selected cluster configuration and inspect the current resources. These commands print resource identities and status, without rendering credential-bearing resources.
source vars.shkubectl --context "$MAIN_CONTEXT" -n "$NAMESPACE" get deployments,pods,services,pvchelm --kube-context "$MAIN_CONTEXT" -n "$NAMESPACE" listkubectl --context "$MAIN_CONTEXT" -n "$NAMESPACE" get httproutesUse the existing encrypted-secret workflow for any required Secret changes. The gateway reads the existing JWT Secret during the connected Helm upgrade. Offline chart rendering uses the test credentials supplied by the chart verification fixtures. A full connected render or diff can contain credentials inside the gateway filter, so use a private review location under tmp/agents/ when one is needed. The application install script writes private logs. Treat those logs as confidential and inspect them locally.
Coordinated cutover
Section titled “Coordinated cutover”Select the two application releases during the planned outage. This limits the cutover to the Supabase and Emergent charts on the existing database and Garage installation. The retained Auth, Storage, Studio and Meta workloads keep their existing Deployment selectors and names.
export OVERRIDES_HELMFILE_DIR="$REPO_ROOT/infra/helmfile"helmfile --kubeconfig "$KUBECONFIG" --kube-context "$MAIN_CONTEXT" -e dev \ -f "$OVERRIDES_HELMFILE_DIR/helmfile.yaml.gotmpl" \ -l name=supabase -l name=emergent sync --skip-needsHelmfile installs the Supabase release before Emergent. Its reconciliation removes the old Functions resources and the routes and Services for removed Supabase components. Emergent then creates emergent-api, its ServiceAccount and its application routes. When hosted agents are enabled, the chart derives their controller RoleBinding from the API’s ServiceAccount and loads their configuration automatically.
Wait for the core workloads. Add supabase-studio and supabase-meta to the rollout checks when the operator profile is enabled.
kubectl --context "$MAIN_CONTEXT" -n "$NAMESPACE" rollout status deployment/supabase-authkubectl --context "$MAIN_CONTEXT" -n "$NAMESPACE" rollout status deployment/supabase-storagekubectl --context "$MAIN_CONTEXT" -n "$NAMESPACE" rollout status deployment/emergent-apikubectl --context "$MAIN_CONTEXT" -n "$NAMESPACE" get deployments,pods,services,pvckubectl --context "$MAIN_CONTEXT" -n "$NAMESPACE" get httproutesUpdate the existing database cleanup job’s stored address after the API is ready. Configure libpq’s PGHOST, PGPORT, PGDATABASE, PGUSER and password source for the intended database, then run the following as the job owner or database administrator. The SQL skips an absent pg_cron catalog, updates only the named job carrying the old cleanup URL, and is safe to run again.
psql -X --set ON_ERROR_STOP=1 \ --file infra/utils/cloudnativepg/supabase/db/cutover-api-host.sqlNew database preparation uses the updated address in z_after.sql. Running the existing database recreation script is a separate destructive workflow.
Verify the deployed services
Section titled “Verify the deployed services”Use WireGuard/Kilo to open Studio through its ClusterIP. Studio’s server reaches Meta through its private Service. Confirm that the snippets are present, schemas and rows load, SQL queries work, Auth users can be administered, and Storage buckets can be browsed. Check that the public sb hostname exposes the intended Auth, Storage and application paths. Studio, Meta and their operator endpoints should be reachable through their private Services, with /pg/ absent from public routing.
From a normal frontend origin, verify sign-in, token refresh, email-hook delivery and authenticated API access. In an isolated test bucket, exercise upload, overwrite, download, signed URLs, deletion and resumable upload. Verify that a server service credential alongside a publishable apikey retains service-role behavior, and a user bearer retains its own identity. Check CORS preflight for Auth, Storage, API, content runtime and LRS. Resource readiness alone cannot establish these behaviors.
After the checks, record the deployed image versions and backup recovery point with the environment’s deployment record. If a service upgrade requires rollback after changing its database schema, follow the backup recovery procedure for that service version alongside the Helm rollback.
Auth key utility
Section titled “Auth key utility”For a deliberate future key change, mise exec -- bun tools/scripts/generate-supabase-auth-keys.ts --help describes the local generator. It accepts the existing HS256 secret through JWT_SECRET in its environment and prints YAML for the encrypted-secret workflow. Its output includes private signing material. Supply the environment through the existing secret-management process and use umask 077 before redirecting output under tmp/agents/. Existing installs retain their current key material during this chart cutover.
When rotating credentials, reconcile the gateway through a connected Helm upgrade and roll the workloads that receive the changed Secret through environment variables. A Secret update alone leaves existing processes using their previous values.