You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(chart): configurable app replicas and a PodDisruptionBudget #584
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