Skip to content

feat(chart): set the number of app replicas #307

Closed

Description

@uniqueg

Problem

Cloud Registry should run with 2 replicas, so that it stays available on node drains, crashes and rolling upgrades. The chart can't set this: FOCA's library chart foca-common 0.2.0 renders the app's Deployment with a fixed replicas: 1, and a Deployment scaled by hand is reset by the next helm upgrade.

Multi-replica safety

The app is correct with several replicas; it already runs as several instances (one per Gunicorn worker, and two pods during rolling updates):

  • Access control: rules granted or revoked via the API (service roles, permissions API, invitations, renames) are recorded by FOCA's adapter, and every instance applies recorded changes before its next enforced request (FOCA docs, access control, "Scaling"); the namespace migration calls mark_changed().
  • Startup tasks (add_service_keys(), resume_renames(), add_service_creators(), reconcile_service_counts(), add_service_types(), sync_pending_services()) are documented and written as idempotent and safe to run concurrently; invitations, locks, counters and types are in MongoDB.
  • Caveats to document: a registration or deletion while a pod starts may make a user's service counter differ by one until the next start (reconcile_service_counts(), already the case with rolling updates); lock staleness (1 minute) compares pod clocks, so node clocks must be synchronized; the bundled MongoDB has one pod, so the app is still unavailable while MongoDB's pod is replaced; upgrades that need the app stopped scale it to 0 and back to cloudRegistry.replicas.

Proposal

Once foca-common 0.3.0 is released (elixir-cloud-aai/foca#584):

  • pin foca-common 0.3.0 (Chart.yaml, Chart.lock, charts.sha256, link of the library docs);
  • expose cloudRegistry.replicas and cloudRegistry.podDisruptionBudget in values.yaml and values.schema.json, and add the template poddisruptionbudget.yaml;
  • document them in deployment/README.md (also docs/deployment.md), with the caveats above, and replace the hard-coded --replicas=1 in the upgrade steps;
  • chart tests.

The default stays 1 replica; the ELIXIR On-Cloud deployment sets 2.

Activity

  1. added this to the v1.0.0-rc1 milestone on Nov 1, 2026
  2. added
    priority: high
    status: blocked
    type: feature
    workload: hours
    on Nov 1, 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: highstatus: blockedtype: featureworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions