Kubernetes / Helm
import { Aside, Steps } from ‘@astrojs/starlight/components’;
VitaSync ships a production-ready Helm chart at helm/vitasync/ with:
- HPA (Horizontal Pod Autoscaler) for API and worker
- PDB (Pod Disruption Budget) for zero-downtime rolling updates
- Ingress support with TLS annotations
pre-install/pre-upgrademigration Job that runs Drizzle migrations before pods are updated- Flexible secret management (inline values or
existingSecret)
Prerequisites
Section titled “Prerequisites”- Kubernetes 1.28+
- Helm 3.12+
- A PostgreSQL 16 database and Redis 7 (in-cluster or managed)
Install
Section titled “Install”-
Create the namespace
Terminal window kubectl create namespace vitasync -
Create a secret (recommended)
Terminal window kubectl create secret generic vitasync-secrets \--namespace vitasync \--from-literal=DATABASE_URL="postgresql://user:pass@host:5432/vitasync" \--from-literal=REDIS_URL="redis://host:6379" \--from-literal=JWT_SECRET="$(openssl rand -base64 32)" \--from-literal=ENCRYPTION_KEY="$(openssl rand -hex 32)" -
Install the chart
Terminal window helm install vitasync ./helm/vitasync \--namespace vitasync \--set ingress.enabled=true \--set ingress.api.host=api.example.com \--set ingress.web.host=app.example.com \--set secrets.existingSecret=vitasync-secrets -
Verify the rollout
Terminal window kubectl rollout status deployment/vitasync-api -n vitasynckubectl rollout status deployment/vitasync-worker -n vitasynckubectl rollout status deployment/vitasync-web -n vitasync
Upgrade
Section titled “Upgrade”helm upgrade vitasync ./helm/vitasync \ --namespace vitasync \ --reuse-valuesThe migration Job runs automatically before pods are replaced.
Key Values
Section titled “Key Values”| Value | Default | Description |
|---|---|---|
api.replicaCount | 2 | API pod replicas |
worker.replicaCount | 1 | Worker pod replicas |
api.autoscaling.enabled | false | Enable HPA for API |
worker.autoscaling.enabled | false | Enable HPA for worker |
api.podDisruptionBudget.enabled | true | PDB for API |
ingress.enabled | false | Enable ingress resources |
ingress.api.host | "" | Hostname for the API ingress |
ingress.web.host | "" | Hostname for the web dashboard |
secrets.existingSecret | "" | Name of an existing Kubernetes Secret |
Production Recommendations
Section titled “Production Recommendations”- Use External Secrets Operator or Sealed Secrets for secret management.
- Enable HPA:
api.autoscaling.enabled=true,worker.autoscaling.enabled=true. - Use a managed PostgreSQL (AWS RDS, GCP Cloud SQL, Supabase) and Redis (ElastiCache, Upstash) for reliability.
- Add
cert-managerannotations to the ingress for automatic TLS via Let’s Encrypt.