Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
name: pgdog
version: v0.74
appVersion: "0.1.52"
version: v0.75
appVersion: "v0.1.52"
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,20 @@ podAntiAffinity:
type: soft # "soft" (preferred) or "hard" (required)
```

#### Multi-AZ

Spread replicas evenly across availability zones with a maximum skew of one:

```yaml
multiAz:
enabled: true
whenUnsatisfiable: ScheduleAnyway
```

This uses the `topology.kubernetes.io/zone` node label. Set
`whenUnsatisfiable` to `DoNotSchedule` to make the constraint strict. Additional
constraints can be set with `topologySpreadConstraints`.

### Config Change Restarts

By default, ConfigMap changes are not automatically picked up by
Expand Down
6 changes: 6 additions & 0 deletions scripts/schema-overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ topologySpreadConstraints:
description: Topology spread constraints
items:
type: object
multiAz.enabled:
type: boolean
description: Enable spreading pods evenly across availability zones
multiAz.whenUnsatisfiable:
enum: ["DoNotSchedule", "ScheduleAnyway"]
description: Action to take when the zone spread constraint cannot be satisfied

# --- Pod anti-affinity ---
podAntiAffinity.enabled:
Expand Down
12 changes: 11 additions & 1 deletion templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,19 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
{{- if or .Values.multiAz.enabled .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- if .Values.multiAz.enabled }}
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: {{ .Values.multiAz.whenUnsatisfiable }}
labelSelector:
matchLabels:
{{- include "pgdog.selectorLabels" . | nindent 14 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if and .Values.statefulSet.enabled .Values.statefulSet.walPvc.enabled }}
volumeClaimTemplates:
Expand Down
4 changes: 4 additions & 0 deletions test/values-multi-az.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Test multi-AZ topology spread rendering
multiAz:
enabled: true
whenUnsatisfiable: DoNotSchedule
6 changes: 6 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ topologySpreadConstraints: []
# matchLabels:
# app: pgdog

# multiAz spreads pods evenly across availability zones with a maximum skew of 1.
multiAz:
enabled: true
# Valid values: DoNotSchedule, ScheduleAnyway
whenUnsatisfiable: ScheduleAnyway

# podAntiAffinity enables default anti-affinity rules to spread pods
# across nodes
# Set to true for automatic pod anti-affinity configuration
Expand Down
Loading