Summary
We've been running the Verdaccio chart with GitOps (ArgoCD) and an HPA, and hit a reconcile loop because the chart hardcodes the replica count. We fixed it in our fork (corticph/verdaccio-charts) and would love to contribute the changes back, but we're unable to open a pull request against this repository (PR creation appears to be restricted for outside contributors - pushing a branch / opening a PR is blocked for us). Opening this issue instead so a maintainer can pull the changes in or advise on the contribution path.
Full diff against master: master...corticph:verdaccio-charts:master
Problem
When autoscaling/HPA is used together with a GitOps controller, the chart and the HPA fight over the replica count:
- The
StatefulSet template hardcodes replicas: 1 when replicaCountEnabled is false.
- An HPA scales the workload up, but the GitOps controller (ArgoCD) then resets it back to
1 from the rendered manifest, which the HPA scales up again - an endless reconcile loop.
There is also currently no built-in support for a HorizontalPodAutoscaler or a PodDisruptionBudget, both of which are useful for running Verdaccio with more than one replica.
Changes in our fork
-
feat(verdaccio): add HPA and stop hardcoding replicas when autoscaling
- New
autoscaling block in values.yaml and an hpa.yaml template (autoscaling/v2) targeting either the Deployment or StatefulSet.
- When
autoscaling.enabled: true, the replicas field is omitted from the Deployment/StatefulSet so the HPA owns the replica count (fixes the ArgoCD ↔ HPA loop).
-
feat(verdaccio): add optional PodDisruptionBudget
- New
pdb.yaml template (policy/v1) gated on podDisruptionBudget.enabled, with mutually-exclusive minAvailable / maxUnavailable. Defaults to maxUnavailable: 1.
-
refactor(verdaccio): extract workload kind into helper template
- New reusable
verdaccio.workloadKind helper (Deployment vs StatefulSet) used by the HPA scaleTargetRef.
These follow the contribution guidelines: README documentation added for all new values, and Chart.yaml bumped 4.32.0 → 4.33.0.
New values
autoscaling:
enabled: false
minReplicas: 2
maxReplicas: 5
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
behavior: {}
podDisruptionBudget:
enabled: false
# minAvailable: 1
maxUnavailable: 1
Ask
Happy to adjust anything to match your conventions. If you can let us know how to get a PR opened (or grant whatever access is needed), we'll send these up properly. Otherwise the compare link above has everything needed to cherry-pick the commits.
Summary
We've been running the Verdaccio chart with GitOps (ArgoCD) and an HPA, and hit a reconcile loop because the chart hardcodes the replica count. We fixed it in our fork (corticph/verdaccio-charts) and would love to contribute the changes back, but we're unable to open a pull request against this repository (PR creation appears to be restricted for outside contributors - pushing a branch / opening a PR is blocked for us). Opening this issue instead so a maintainer can pull the changes in or advise on the contribution path.
Full diff against
master: master...corticph:verdaccio-charts:masterProblem
When
autoscaling/HPA is used together with a GitOps controller, the chart and the HPA fight over the replica count:StatefulSettemplate hardcodesreplicas: 1whenreplicaCountEnabledisfalse.1from the rendered manifest, which the HPA scales up again - an endless reconcile loop.There is also currently no built-in support for a
HorizontalPodAutoscaleror aPodDisruptionBudget, both of which are useful for running Verdaccio with more than one replica.Changes in our fork
feat(verdaccio): add HPA and stop hardcoding replicas when autoscalingautoscalingblock invalues.yamland anhpa.yamltemplate (autoscaling/v2) targeting either theDeploymentorStatefulSet.autoscaling.enabled: true, thereplicasfield is omitted from theDeployment/StatefulSetso the HPA owns the replica count (fixes the ArgoCD ↔ HPA loop).feat(verdaccio): add optional PodDisruptionBudgetpdb.yamltemplate (policy/v1) gated onpodDisruptionBudget.enabled, with mutually-exclusiveminAvailable/maxUnavailable. Defaults tomaxUnavailable: 1.refactor(verdaccio): extract workload kind into helper templateverdaccio.workloadKindhelper (Deployment vs StatefulSet) used by the HPAscaleTargetRef.These follow the contribution guidelines: README documentation added for all new values, and
Chart.yamlbumped4.32.0→4.33.0.New values
Ask
Happy to adjust anything to match your conventions. If you can let us know how to get a PR opened (or grant whatever access is needed), we'll send these up properly. Otherwise the compare link above has everything needed to cherry-pick the commits.