SPENDLE / DOCUMENTATION / ARGO CD

Deploy with app-of-apps.

Deploy the Spendle backend and web workspace with Helm charts managed by Argo CD.

1. Request registry access and get the starter

You need access to MTD’s container registry to download the Spendle Docker images. Email contact@mtdtechnology.net to request access before deploying. Include your organization’s name. MTD will provide the registry access details and approved image versions.

Download the app-of-apps starter (.zip). It contains copies of the application charts, example values, a parent Argo CD Application and two child Applications. This is a configuration template; it does not include credentials, images or infrastructure services.

spendle-deployment/
  bootstrap/root.yaml
  apps/backend.yaml
  apps/web.yaml
  charts/backend/
  charts/web/
  values/backend.yaml
  values/web.yaml

Copy the contents of this directory to the root of an administrator-controlled Git repository. The parent reads only apps/; each child renders its application Helm chart with the matching values file. The starter uses Git-hosted charts so no public Helm registry is required.

2. Prepare infrastructure

  1. Prepare Kubernetes, kubectl, Helm 3 or later, and an installed Argo CD instance in namespace argocd. Connect Argo CD to your repository if it is private.
  2. Provision PostgreSQL and a dedicated Spendle database and account. The application charts do not install a database.
  3. Prepare Keycloak and its realm. The backend configuration uses spendle-client and spendle-admin; the web default is spendle-ops-client. Configure the required client types, service permissions, roles and mobile redirects with MTD rather than importing a guessed realm.
  4. Provide a Google Cloud Storage bucket and scoped credentials for attachments. The current backend expects GCS.
  5. Configure an ingress controller, DNS and TLS for the web workspace and backend. Keycloak must also use a reachable HTTPS URL.
  6. Obtain approved backend/web image tags, registry pull access, and the provisioning signing key matching the mobile apps’ trusted public key.

The cluster, backend, web workspace and phones must reach the appropriate identity endpoints. A local-only backend URL will not work on a phone outside that network.

3. Configure values and secrets

Follow the runtime secret table and the backend and web configuration examples in the full deployment reference. Those examples are also included as the starter’s values files.

  1. Replace the image tags, database host, database name/user, bucket and all example domains in both values files.
  2. Keep CONTROL_PLANE_ENABLED: "false" for this organization’s backend.
  3. Register the backend https://YOUR_API_HOST/callback and web https://YOUR_WEB_HOST/api/auth/callback/keycloak redirects with their respective Keycloak clients. Confirm native mobile redirects with MTD.
  4. Create namespace spendle, then supply the existing secrets listed below using your secret manager. Keep secrets.create: false.
kubectl create namespace spendle
# Supply these resources through your secret management process:
# spendle-bk-runtime-env: DB_PASSWORD, KEYCLOAK_CLIENT_SECRET,
#   KEYCLOAK_ADMIN_CLIENT_SECRET, SPENDLE_KEYCLOAK_CLIENT_SECRET, FX_API_TOKEN
# spendle-web-runtime-env: NEXTAUTH_SECRET, KEYCLOAK_SECRET,
#   PROVISIONING_SIGNING_PRIVATE_KEY
# spendle-bk-gcp-credentials: key "latest" containing GCS credentials JSON
# ghcr-pull-secret: registry authentication
# spendle-api-tls and spendle-web-tls: TLS certificates and private keys

The signing key is base64-encoded PKCS#8 P-256 and must match the key trusted by the mobile applications. Creating an unrelated key will not make the distributed apps accept your QR code. Confirm FX service access where currency features require it. Do not commit credentials to Git.

4. Pin your GitOps sources

In both child manifests, replace YOUR_ORG/YOUR_GITOPS_REPO with your repository and REPLACE_WITH_GIT_COMMIT with a commit containing the configured charts and values. Commit these child manifests. Then set the parent’s repository URL and revision to that newer commit containing the children.

This separates the parent’s child-manifest revision from each child’s chart revision. For upgrades, commit new charts/values, update the child revisions, then update the parent revision. Avoid mutable image tags such as latest.

The starter uses the default Argo CD project for an administrator-run example. In production, use a restricted AppProject with explicit source and destination permissions. Protect changes to the parent and child manifests: they control deployment access.

The pattern follows Argo CD’s app-of-apps guidance. Helm values paths are relative to each chart, as described in Argo CD’s Helm guide.

5. Validate and sync

From your GitOps repository root, lint and render the charts first. Review the output locally, then bootstrap and sync each Application explicitly. Automated sync and pruning are disabled in this starter.

helm lint ./charts/backend -f values/backend.yaml
helm lint ./charts/web -f values/web.yaml
helm template spendle-bk ./charts/backend -n spendle -f values/backend.yaml
helm template spendle-web ./charts/web -n spendle -f values/web.yaml

kubectl apply -f bootstrap/root.yaml
# Requires an authenticated Argo CD CLI session:
argocd app sync spendle-deployment
argocd app wait spendle-deployment --sync --timeout 120
argocd app sync spendle-bk
argocd app wait spendle-bk --sync --health --timeout 600
argocd app sync spendle-web
argocd app wait spendle-web --sync --health --timeout 600
kubectl get pods,services,ingress -n spendle

The parent creates child Application resources; syncing the parent alone does not deploy the children in this manual-sync example. Argo CD renders the Helm charts and manages their resources. Use Git changes and Argo CD syncs for subsequent releases rather than running Helm upgrades against the same workloads.

6. Verify the deployment

  1. Check that workloads are ready and all public URLs have valid TLS.
  2. Sign in through Keycloak with a test employee and a separate authorized reviewer.
  3. Open the workspace provisioning page, scan its signed QR code with the iOS or Android app, and sign in.
  4. Create an expense request, create an expense report, attach a test document and complete the configured review flow.
  5. Confirm database persistence, document storage access and backups.

Backend readiness uses TCP probes, so a ready pod does not verify database, storage or Keycloak access. Investigate image pulls, secret names, realm URLs, registered redirects and signing-key compatibility when troubleshooting.

For upgrades and recovery, follow the operations reference, while keeping Argo CD as the resource owner. Revert the desired Git revision and sync for a workload rollback; database migrations need their own recovery plan.

Where to publish the charts

Recommended layout: a public GitHub repository named spendle-deploy for reviewed examples and chart source, GHCR for versioned OCI Helm packages and container images, and a separate private GitOps repository for each organization’s values and Application manifests. These are proposed names, not published download locations.

  • GitHub + GHCR: keeps releases close to the existing GHCR image workflow. Helm supports OCI chart registries. Publish immutable chart versions and test public anonymous pulls before linking them here.
  • GitHub Pages: a conventional Helm repository with index.yaml and packaged charts, suitable for a simple public chart catalog.
  • Harbor or an organization registry: suitable when chart access, image access and retention must be managed within a private platform.

The included example uses vendored charts in Git. After publishing a registry, the child Applications can reference released charts and keep environment values in the private GitOps repository using Argo CD multiple sources.