Skip to content

feat(chart): configurable app replicas and a PodDisruptionBudget #584

Closed

Description

@uniqueg

Problem

The library chart foca-common (0.2.0) renders the app's Deployment with a fixed replicas: 1 (charts/foca-common/templates/_deployment.tpl), with no value to change it. Deployments that need the app to stay available during node drains, crashes and rolling upgrades (e.g., Cloud Registry for ELIXIR On-Cloud, with 2 replicas) can only scale the Deployment by hand, which the next helm upgrade resets. There is no PodDisruptionBudget either, so a node drain may evict all replicas at once.

Multi-replica safety

FOCA apps already run as several instances: one per Gunicorn worker, and two pods during rolling updates. Access control is designed for it: each instance checks a change record (<collection>_changes) before every use of its enforcer and applies the changed rules (docs/access-control.md, "Scaling"; foca/security/access_control/enforcer_cache.py), and configured policies are replaced in generations, safe for instances starting concurrently (FocaCasbinAdapter.set_configured_policies()). More pods add no new kinds of race; the caveats (rules changed in the database directly need mark_changed(), per-instance caches and memory, a single MongoDB pod) should be documented.

Proposal

  • <valuesKey>.replicas (integer >= 1, default 1): number of app pods, named like the existing worker.replicas.
  • <valuesKey>.podDisruptionBudget: enabled (default true), minAvailable or maxUnavailable (at most one; maxUnavailable: 1 if neither is set). New template foca-common.podDisruptionBudget, rendered only if enabled and replicas > 1 (with one replica, a budget would block node drains).
  • Schema (app-values.schema.json), the petstore example's chart, template tests, docs (docs/helm-chart.md, including the caveats of several replicas), and a version bump of the chart to 0.3.0.

Activity

  1. added this to the v0.20.0 milestone on Nov 1, 2026
  2. added
    priority: high
    status: in progress
    type: feature
    workload: hours
    on Nov 1, 2026
  3. removed
    status: in progress
    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: hightype: featureworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions