Skip to content

Preview apps

Every merge request gets an automatic ArgoCD preview environment, deployed through the shared openxchange/ci/argocd CI component; the persistent booking-main environment is instead owned by a declarative ApplicationSet in argocd/, with CI reduced to an image rollout (see ADR-0008).

What gets deployed

The zero-input mr-preview component deploys two envsubst-templated ArgoCD Applications under .gitlab/argocd/ (see ADR-0008):

  • preview-infra.yaml → the deploy preview infra job. A single-source app over helm/booking-preview — ephemeral infra: the owned Namespace, MariaDB (operator CRD), redis, a Garage S3 companion for the ui-middleware asset store, the shared App Suite middleware ExternalName, and an Istio VirtualService routing /api and /ui/v1 into the shared appsuite-main stack while keeping /booking/* in-namespace. The whole ephemeral asset-store state is rolled on every commit (rolloutId = $CI_COMMIT_SHA): the Garage pod (EmptyDir) and the in-memory redis carrying the ui-middleware's version bookkeeping; the garage-operator re-ensures bucket and key on the fresh instance by itself (the cluster runs a patched operator image for this until the fix lands upstream). Each commit therefore deploys against a fresh, consistent store — Garage degrades once bucket metadata accumulates, and deleting versions only trades them for tombstones that are GCed after 24h, so MR previews keep no version history at all. The state must die together: wiping only Garage leaves redis claiming a UI version is uploaded while the store is empty, and the updater then serves 404s. Long-lived deployments from this chart (booking-main) don't set rolloutId: they keep the stable pods and prune superseded versions with the ui-service-version-gc CronJob instead, which is good enough at a handful of deploys a day without e2e racing the rollout.
  • preview-app.yaml → the deploy preview job. A multi-source app over:
    • helm/booking — Booking itself, image.tag = $CI_COMMIT_REF_SLUG (a mutable per-branch tag; pullPolicy: Always + the io.ox.commit-sha annotation from global.commitSha roll the pod on each commit). Its migration Job retries against the MariaDB the infra app brings up (the Job's backoffLimit covers the DB's provisioning window, so no cross-app ordering is needed).
    • core-ui-middleware — the in-namespace App Suite shell that discovers Booking's UI plugin.

There is no full App Suite deployment per preview — middleware and core-ui are shared, reached via ExternalName/Istio routing; only Booking-specific infrastructure is per-namespace.

Documentation at /booking/docs

This documentation is deployed alongside every preview, so a branch's docs can be read at https://<preview host>/booking/docs. It is a separate image, not part of the service: the service has no business serving a static site, and keeping them apart means docs changes never touch the app image.

  • docs/Dockerfile builds the VuePress site and copies it into the org's wolfi/nginx base image under /usr/share/nginx/html/docs. That base serves /usr/share/nginx/html on port 8080, so the site needs no nginx config of its own. The build context is the repo root, because the build needs the pnpm workspace files and the markdown sources.
  • The build docs image CI job pushes it to $CI_REGISTRY_IMAGE/docs with the branch slug as tag, next to the app and e2e images.
  • helm/booking-preview deploys it (templates/docs.yaml) and routes it (templates/virtualservice.yaml). The image reference is injected by the ArgoCD manifests like the third-party images below, since the tag differs per environment: the branch slug for previews, main for booking-main.

The site is built with the public base /booking/docs, while the image serves it internally under /docs, so the route rewrites the prefix on the way in. The base has to be the browser-visible prefix: a static site emits absolute asset URLs, and an Istio rewrite only changes what the upstream sees. For the same reason the bare /booking/docs is answered with a redirect to /booking/docs/ rather than being rewritten — nginx would otherwise reply to the directory request with a redirect to its internal /docs/, which is not routed.

Set docs.enabled: false to leave it out of a deployment.

Where third-party image digests live

helm/booking-preview pins no third-party image itself. MariaDB, redis, mailpit and the Garage version-GC image are all injected as Helm parameters by the two ArgoCD manifests (argocd/application.yaml for booking-main, .gitlab/argocd/preview-infra.yaml for MR previews), each carrying a # renovate: comment picked up by the custom manager in renovate.json. The chart's values leave them empty and the templates fail rendering with a clear message if a deployment forgets one. Bumping a digest therefore touches a manifest, not chart content, so it needs no Chart.yaml version bump and can automerge past the lint helm chart gate. Add new third-party images the same way.

Getting a preview

  1. Open a merge request — the deploy preview job runs automatically on every MR.
  2. deploy preview infra brings up the infra app and deploy preview creates, syncs and blocks on argocd app wait --sync --health, so a green deploy job means the whole live stack (infra + Booking + core-ui-middleware) is running this commit.
  3. The preview becomes available at https://booking-<slug>.$KUBE_INGRESS_BASE_DOMAIN (e.g. https://booking-<slug>.dev.oxui.de), in namespace booking-<slug>. The component derives <slug> from $CI_COMMIT_REF_SLUG.
  4. The e2e tests - codeceptjs job runs against the preview URL.

Closing or merging the MR runs the teardown preview job (the environment's on_stop), which argocd app delete --cascades the Application; auto-stop-in (default 1 week) tears an idle preview down on its own. The preview chart templates the Namespace resource itself so ArgoCD owns and cascade-deletes it.

Main environment

booking-main is declarative, not driven by a CI deploy job. The ApplicationSet in argocd/application.yaml owns it (selfHeal, prune) and renders the same three sources (Booking + infra

  • core-ui-middleware) into namespace booking-main at https://booking-main.dev.oxui.de. On each main pipeline the rollout CI job bumps global.commitSha on the Booking source (source-position: "1") and waits for synced+healthy, so the freshly built :main image rolls out — CI never creates or deletes the app. It runs the same ephemeral in-namespace MariaDB/Garage as the previews (no durable storage; see ADR-0008).

One-time cluster / CI setup

  1. Group CI/CD variables: ARGOCD_SERVER and ARGOCD_AUTH_TOKEN (the component drives the ArgoCD CLI), and KUBE_INGRESS_BASE_DOMAIN (with wildcard DNS) for the preview URLs.
  2. An ArgoCD AppProject (default shared-deployments) that permits this repo and the destination cluster/namespaces, and covers the registry.open-xchange.com OCI chart + image credentials the previews use.
  3. The consuming repo must be readable by ArgoCD (registered or group-covered) — ArgoCD pulls the chart/manifests from Git.
  4. Cluster prerequisites: the MariaDB operator (k8s.mariadb.com) and the Garage operator (garage.rajsingh.info) must be installed — both are already required by other previews on this cluster (e2e-environment, teams).
  5. For booking-main: no manual step. The cluster's scm-discoveryApplicationSet scans the openxchange/appsuite group and applies the argocd/ directory of any repo that carries the argocd (or preview-apps) GitLab project topic — booking already has the argocd topic, so once argocd/ is on main it creates a bootstrap-booking Application that syncs argocd/application.yaml, yielding the booking-main ApplicationSet. MR previews don't rely on this — the mr-preview component applies their Applications imperatively.

Migrating from the old imperative booking-main

Before this layout, main deployed booking-main imperatively via a deploy main CI job, leaving a standalone booking-main Application (no ownerReferences). The new ApplicationSet generates an Application of the same name, so the old one must be removed once for the set to own it:

# zero-downtime: orphan the workloads, let scm-discovery's ApplicationSet re-adopt
kubectl delete application booking-main -n argocd --cascade=orphan
# or simply redeploy from scratch (booking-main has no durable data):
kubectl delete application booking-main -n argocd

Do this around the merge that lands argocd/ on main. It is a one-time step; afterwards booking-main is fully declarative.

Verifying a fresh setup

  • The core-ui-middleware Service name referenced by the VirtualService (<release>-core-ui-middleware, derived from the release name) matches what's deployed.
  • The open-xchange-registry-credentials pull secret exists in the preview namespace for registry.open-xchange.com images.
  • The MariaDB and Garage operators are healthy in the cluster before expecting a preview to come up clean.
  • Deployment — the production Helm chart these preview values extend
  • ADR-0008 — the CI component + declarative booking-main, and the mutable branch-slug image tag
  • ADR-0009 — why migration.jobId matters especially for ephemeral preview databases (they lose schema on Pod restart, so a pipeline retry must re-run the migration)