Skip to content

Shared Helm library chart for FOCA apps #312

Closed
4 of 4 issues completed
Closed

Description

@uniqueg

Why?

Most FOCA apps (cloud-registry, proWES, proTES, and others) are deployed on Kubernetes, and each one keeps its own Helm chart. These charts are largely copies of one another, and they drift apart: cloud-registry's chart, for example, still uses a Job with namespace admin rights to patch a ConfigMap at install time, which never applies some of its values (wrong YAML paths), races the app pods, and is reset by helm upgrade. Fixes and best practices (config overlays, secrets, probes, OpenShift compatibility) have to be redone in every repository.

FOCA already provides the building blocks that charts need, so one shared chart could implement them once:

  • Config overlays: FOCA_CONFIG_OVERLAY merges deployment-specific YAML files on top of the config baked into the image (FOCA ≥ 0.14).
  • Secrets via environment variables: MONGO_URI / MONGO_USERNAME / MONGO_PASSWORD, CELERY_BROKER_URL / CELERY_RESULT_BACKEND.
  • A non-root base image (UID 1000, GID 0) that runs under OpenShift's arbitrary UIDs.

How?

  1. Provide a Helm library chart (type: library), e.g. foca-common, with named templates that app charts include, rather than a fully generic application chart. Apps keep a thin chart (their own Chart.yaml, values.yaml and a few one-line templates such as {{ include "foca.deployment" . }}), so they can add app-specific resources (e.g. Celery workers) without forking.
  2. Templates (each optional through values):
    • Deployment for the app: image, resources, non-root securityContext compatible with OpenShift, readiness and liveness probes on a configurable path.
    • ConfigMap with overlay.yaml rendered from .Values.config (toYaml), mounted as a directory (no subPath), referenced by FOCA_CONFIG_OVERLAY, and a checksum/config pod annotation so that helm upgrade rolls the pods when the config changes.
    • Secret wiring: existingSecret-style values mapped to MONGO_URI (or username and password) and Celery URLs via secretKeyRef. No secrets in ConfigMaps or values files.
    • Service, Ingress (with optional cert-manager TLS) and OpenShift Route (rendered when the Route API exists and ingress is disabled).
    • Optional MongoDB (Deployment + Service + PVC, pinned major version) for small deployments, with the option to point at an external database instead.
    • Optional Celery worker and broker for apps that use background jobs (proWES, proTES).
  3. Ship a values.schema.json so that typos in values fail at helm install / helm lint.
  4. Location and publishing: either a charts/ folder in this repo or a separate elixir-cloud-aai/helm-charts repo, published as an OCI artifact (e.g. oci://ghcr.io/elixir-cloud-aai/charts) or as a GitHub Pages chart repo via chart-releaser. Chart versions follow SemVer independently of FOCA, with the minimum supported FOCA version documented.
  5. CI: helm lint, helm template snapshot tests, and an install test on a kind cluster (e.g. with chart-testing) using the petstore example image.
  6. Docs: a page in FOCA's docs on how to build an app chart on top of the library chart, extending the Kubernetes deployment guide.
  7. Migrate one app first (cloud-registry is the natural candidate, since its chart needs rework anyway), then the others.

Open questions

  • Library chart (flexible, a little boilerplate per app) or one generic application chart (no per-app templates, less flexible)? The proposal above favors the library chart.
  • Keep the chart in this repo (versioned next to FOCA) or in a separate charts repo (independent releases, one place for all ELIXIR Cloud charts)?
  • Is a bundled MongoDB worth maintaining, or should the chart only support an external database?

Acceptance criteria

  • The library chart is published and versioned, with CI (lint, template tests, kind install test).
  • The petstore example deploys with a thin chart based on the library chart.
  • Deployment-specific config is set only through Helm values (rendered into a FOCA_CONFIG_OVERLAY file), secrets only through Kubernetes Secrets, and changing either and running helm upgrade rolls the pods.
  • Works on plain Kubernetes and on OpenShift.
  • At least one production app (e.g. cloud-registry) uses it.
  • Documented in FOCA's docs.

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    priority: medium
    status flag: discuss
    type: delivery
    type: feature
    workload: days
    on Oct 19, 2026
  2. added
    status: in progress
    and removed
    status flag: discuss
    on Oct 21, 2026
  3. uniqueg commented on Oct 21, 2026

    @uniqueg
    MemberAuthor

    Decisions on the open questions (2026-10-21):

    1. Library chart (type: library), apps keep thin charts.
    2. In this repo under charts/, versioned independently with chart-v* tags, published as OCI to oci://ghcr.io/elixir-cloud-aai/charts.
    3. The optional bundled MongoDB stays; external databases remain possible.

    Split into sub-issues: #350 (core library chart, extracted from cloud-registry's chart v3), #351 (Celery worker and broker, with proTES), elixir-cloud-aai/cloud-registry#158 (cloud-registry uses the library chart).

  4. uniqueg commented on Oct 23, 2026

    @uniqueg
    MemberAuthor
  5. removed
    status: in progress
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype: deliverytype: featureworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions