Kubernetes
Deploy instancez on Kubernetes using the official Helm chart.
Overview
Section titled “Overview”instancez ships a Helm chart at helm/instancez/ in the repository. It deploys the instancez backend and, optionally, a bundled PostgreSQL instance. Sensitive values (adminKey and the Postgres password) are auto-generated on first install and preserved across upgrades.
Prerequisites
Section titled “Prerequisites”Quick start (bundled Postgres)
Section titled “Quick start (bundled Postgres)”The default chart values enable a bundled Postgres instance. To install with all defaults:
helm install instancez ./helm/instancezadminKey and the Postgres password are auto-generated as 32-character random strings and stored in a Kubernetes Secret named instancez. They are stable — the values are generated once and reused on every subsequent helm upgrade.
Retrieve the generated credentials:
kubectl get secret instancez -o jsonpath='{.data.adminKey}' | base64 -dProviding your own values
Section titled “Providing your own values”Pass values on the command line with --set:
helm install instancez ./helm/instancez \ --set adminKey=my-admin-keyOr save them in a values file and pass it with -f:
adminKey: my-admin-keyhelm install instancez ./helm/instancez -f my-values.yamlCustom instancez config
Section titled “Custom instancez config”The config value is written verbatim to a ConfigMap and mounted as /app/instancez.yaml inside the pod. Override it in your values file to configure tables, RLS policies, and other instancez settings:
config: | version: 1 project: name: my-project server: port: 8080 tables: - name: posts columns: - name: id type: uuid primaryKey: trueSee instancez.yaml reference for the full schema.
External Postgres
Section titled “External Postgres”To use an existing Postgres instance instead of the bundled one, disable the bundled Postgres and provide a superuser DSN:
helm install instancez ./helm/instancez \ --set postgres.enabled=false \ --set externalPostgres.url="postgres://superuser:pass@your-db:5432/instancez"The DSN must be a superuser connection — instancez provisions the instancez_owner and authenticator roles on startup and requires CREATEROLE CREATEDB BYPASSRLS privileges.
Ingress
Section titled “Ingress”Enable and configure Ingress in your values file:
ingress: enabled: true className: nginx host: instancez.example.comTLS can be added via the ingress.tls list:
ingress: enabled: true className: nginx host: instancez.example.com tls: - hosts: - instancez.example.com secretName: instancez-tlsUpgrading
Section titled “Upgrading”helm upgrade instancez ./helm/instancezAuto-generated secrets (adminKey and the bundled Postgres password) are read from the existing Kubernetes Secret and not regenerated on upgrade, so credentials are preserved.
To upgrade with a new values file:
helm upgrade instancez ./helm/instancez -f my-values.yamlPassword rotation
Section titled “Password rotation”To rotate credentials:
- Update the
instancezKubernetes Secret directly — editadminKeyordatabaseUrl(and the bundled Postgres password if applicable). - Restart the pod so instancez picks up the new values:
kubectl rollout restart deployment/instancezinstancez re-reads the superuser DSN on startup and syncs all Postgres role passwords, so the instancez_owner and authenticator role passwords are updated automatically from the new DSN.
Health checks
Section titled “Health checks”| Endpoint | Behaviour |
|---|---|
GET /live | Returns 200 when the process is alive |
GET /health | Always returns 200 once the process is serving requests |
GET /ready | Returns 200 when Postgres is reachable; 503 otherwise |
The chart configures liveness (/live) and readiness (/ready) probes automatically. Use /ready for external load-balancer checks.