Skip to content

feat(sentinel): configurable deployment strategy and PDB minAvailable - #33

Merged
binhnguyenduc merged 1 commit into
masterfrom
feat/deployment-strategy-pdb-knobs
Jul 24, 2026
Merged

feat(sentinel): configurable deployment strategy and PDB minAvailable#33
binhnguyenduc merged 1 commit into
masterfrom
feat/deployment-strategy-pdb-knobs

Conversation

@binhnguyenduc

Copy link
Copy Markdown

What

Adds two rollout/availability knobs that were previously hardcoded:

  1. sentinel.strategy — overrides the sentinel Deployment update strategy (e.g. rollingUpdate.maxSurge/maxUnavailable, or Recreate).
  2. redis.podDisruptionBudgetMinAvailable / sentinel.podDisruptionBudgetMinAvailable — overrides the PodDisruptionBudget minAvailable (int or percentage), previously fixed at 2 (or 1 when redis replicas <= 2).

Why

  • With required anti-affinity and replicas == nodes, the default sentinel rolling update can't surge a new pod and deadlocks. maxSurge/maxUnavailable control fixes this.
  • A fixed PDB minAvailable doesn't fit every topology; making it configurable lets operators tune disruption tolerance.

Compatibility

Both fields are optional; unset preserves today's behaviour exactly (default rolling update, minAvailable = 2/1).

Changes

  • api/.../types.go: SentinelSettings.Strategy, {Redis,Sentinel}Settings.PodDisruptionBudgetMinAvailable.
  • generator.go / client.go: wire strategy into the Deployment and the override into the PDB.
  • Regenerated CRD (manifests/, kustomize base, chart crds/) + deepcopy.
  • Tests for the strategy and the minAvailable override; README docs.

Upstream references

Test

go build ./..., go test ./..., gofmt clean; CRD regenerated via pinned codegen image.

Two rollout/availability knobs that were previously hardcoded:

- sentinel.strategy overrides the sentinel Deployment update strategy
  (e.g. rollingUpdate maxSurge/maxUnavailable), avoiding a deadlocked
  rolling update when required anti-affinity plus replicas==nodes leaves
  no room to surge.
- redis/sentinel.podDisruptionBudgetMinAvailable overrides the PDB
  minAvailable (previously fixed at 2, or 1 when replicas<=2).

Regenerated CRD + deepcopy for the new fields.

Refs upstream spotahome#662, spotahome#516, spotahome#598.
@binhnguyenduc
binhnguyenduc merged commit a53177d into master Jul 24, 2026
8 checks passed
@binhnguyenduc
binhnguyenduc deleted the feat/deployment-strategy-pdb-knobs branch July 24, 2026 09:32
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.

1 participant