Skip to main content

Deployment

Images​

The CI builds two images: backend (the Go binary) and frontend (nginx with the UI, proxying /api/ to a service named backend).

Helm​

CI pushes the chart to the project's OCI registry:

helm install pager oci://<registry>/<project-path>/charts/pager --version <version> \
--set secrets.inline.jwtSecret=$(openssl rand -hex 32) \
--set ingress.enabled=true --set 'ingress.hosts={pager.example.com}'

Important values:

ValueMeaning
config.database.driversqlite (default, one backend replica, PVC at /data), postgres or mariadb
config.database.host/port/name/userConnection entries for postgres and mariadb
secrets.inline.jwtSecret, secrets.inline.dbPasswordOr use secrets.existingSecret with keys JWT_SECRET, DB_PASSWORD
secrets.inline.vapidPublicKey/vapidPrivateKeyOptional; otherwise generated and stored in the database
config.cookieSecuretrue by default. Set false only without HTTPS
replicaCountNeeds postgres or mariadb when above 1

The ingress sends /api straight to the backend service and everything else to frontend (set ingress.exposeSwagger=true to also route /swagger to the backend). The backend accepts traffic only from the frontend pods and from the ingress controller namespace (networkPolicy.ingressControllerNamespaceLabels, default traefik). Run one release per namespace because the service names are fixed. Terminate TLS at the ingress: Web Push needs HTTPS.

Rolling updates with several replicas​

While pods are replaced, old and new frontend versions run side by side and a browser can get index.html from one version and a hashed file from the other, which answers 404. Three things handle this:

  • The page notices a failed /assets/… request and reloads itself (up to 8 times, with a short random delay) until it gets a matching pair. Users see a short flicker instead of a blank page.
  • index.html is sent with Cache-Control: no-cache and hashed assets with a one-year lifetime, so clients never keep a stale entry point. Missing assets are a real 404.
  • The chart rolls out one pod at a time (strategy.rollingUpdate: maxUnavailable: 0, maxSurge: 1). To keep a browser on one pod during the rollout, enable sticky sessions on the frontend Service, e.g. for Traefik: frontend.serviceAnnotations: {"traefik.ingress.kubernetes.io/service.sticky.cookie": "true"}.