Skip to content

feat(vaultwarden): add topologySpreadConstraints support - #234

Merged
guerzon merged 1 commit into
guerzon:mainfrom
somaz94:feat/topology-spread-constraints
Aug 7, 2026
Merged

feat(vaultwarden): add topologySpreadConstraints support#234
guerzon merged 1 commit into
guerzon:mainfrom
somaz94:feat/topology-spread-constraints

Conversation

@somaz94

@somaz94 somaz94 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What this does

Adds an opt-in topologySpreadConstraints field so pods can be spread across zones/nodes for higher availability. This complements the existing nodeSelector, affinity, tolerations, and priorityClassName scheduling knobs already exposed on the pod spec.

Why

Multi-node clusters running more than one replica (replicas > 1, or a StatefulSet) currently have no built-in way to enforce even pod distribution across topology domains. topologySpreadConstraints is the standard Kubernetes primitive for this and rounds out the scheduling surface of the chart.

Changes

  • templates/_podSpec.tpl — render topologySpreadConstraints from values (shared by both the Deployment and StatefulSet paths via vaultwarden.podSpec)
  • values.yaml — new topologySpreadConstraints: [] parameter with @param doc annotation
  • README.md — regenerated via the bitnami readme-generator-for-helm tool (generate-readme.sh)
  • Chart.yaml — version bump 0.43.10.44.0 (SemVer minor, per CONTRIBUTING)

Backward compatibility

The field defaults to [], so the {{- with .Values.topologySpreadConstraints }} block is skipped when unset. Rendered output for existing users is byte-identical (verified with helm template diff against main, version bump aside).

Usage

topologySpreadConstraints:
  - maxSkew: 1
    topologyKey: kubernetes.io/hostname
    whenUnsatisfiable: DoNotSchedule
    labelSelector:
      matchLabels:
        app.kubernetes.io/name: vaultwarden

Testing

  • helm lint — pass
  • ct lint — pass
  • helm template with the field set renders topologySpreadConstraints correctly on both Deployment and StatefulSet
  • helm template with the field unset is byte-identical to main

somaz94 added a commit to somaz94/somaz94 that referenced this pull request Jul 2, 2026
@somaz94
somaz94 marked this pull request as ready for review July 21, 2026 07:18
@somaz94
somaz94 force-pushed the feat/topology-spread-constraints branch from 15b1a7d to 8c9187a Compare July 28, 2026 06:29
Signed-off-by: somaz <genius5711@gmail.com>
@somaz94
somaz94 force-pushed the feat/topology-spread-constraints branch from 8c9187a to 9d4d8e3 Compare August 7, 2026 01:57
@guerzon
guerzon merged commit b8bea26 into guerzon:main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants