Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Workbench or REST API.
- Added `publishNotReadyAddresses` to `service`, `headlessService`, `proxy.service` and `proxy.headlessService`.
Headless services default to `true` to allow cluster nodes to communicate before readiness probes pass,
enabling proper startup sequencing during rolling upgrades.
- Added `topologySpreadConstraintsPreset` for GraphDB and proxy StatefulSets. When enabled, automatically
configures two topology spread constraints that spread pods across availability zones
(`topology.kubernetes.io/zone`) and nodes (`kubernetes.io/hostname`). Simplifies cloud deployments on
AWS/Azure/GCP with multiple availability zones. Explicit `topologySpreadConstraints` takes precedence
when set.


## Version 12.4.0
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ IMPORTANT: This is generated by helm-docs, do not attempt modifying it on hand a
| proxy.terminationGracePeriodSeconds | int | `30` | |
| proxy.tolerations | list | `[]` | |
| proxy.topologySpreadConstraints | list | `[]` | |
| proxy.topologySpreadConstraintsPreset.enabled | bool | `false` | |
| proxy.topologySpreadConstraintsPreset.maxSkew | int | `1` | |
| proxy.topologySpreadConstraintsPreset.whenUnsatisfiable | string | `"ScheduleAnyway"` | |
| proxy.updateStrategy.type | string | `"RollingUpdate"` | |
| readinessProbe.httpGet.path | string | `"/protocol"` | |
| readinessProbe.httpGet.port | string | `"http"` | |
Expand Down Expand Up @@ -690,6 +693,9 @@ IMPORTANT: This is generated by helm-docs, do not attempt modifying it on hand a
| terminationGracePeriodSeconds | int | `120` | |
| tolerations | list | `[]` | |
| topologySpreadConstraints | list | `[]` | |
| topologySpreadConstraintsPreset.enabled | bool | `false` | |
| topologySpreadConstraintsPreset.maxSkew | int | `1` | |
| topologySpreadConstraintsPreset.whenUnsatisfiable | string | `"ScheduleAnyway"` | |
| updateStrategy.type | string | `"RollingUpdate"` | |

## Troubleshooting
Expand Down
24 changes: 22 additions & 2 deletions templates/graphdb/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,28 @@ spec:
{{- with .Values.tolerations }}
tolerations: {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints: {{- tpl (toYaml .) $ | nindent 8 }}
{{- if or .Values.topologySpreadConstraints .Values.topologySpreadConstraintsPreset.enabled }}
topologySpreadConstraints:
{{- if .Values.topologySpreadConstraints }}
{{- tpl (toYaml .Values.topologySpreadConstraints) $ | nindent 8 }}
{{- else }}
- labelSelector:
matchLabels:
{{- include "graphdb.selectorLabels" . | nindent 14 }}
matchLabelKeys:
- pod-template-hash
topologyKey: topology.kubernetes.io/zone
maxSkew: {{ .Values.topologySpreadConstraintsPreset.maxSkew }}
whenUnsatisfiable: {{ .Values.topologySpreadConstraintsPreset.whenUnsatisfiable }}
- labelSelector:
matchLabels:
{{- include "graphdb.selectorLabels" . | nindent 14 }}
matchLabelKeys:
- pod-template-hash
topologyKey: kubernetes.io/hostname
maxSkew: {{ .Values.topologySpreadConstraintsPreset.maxSkew }}
whenUnsatisfiable: {{ .Values.topologySpreadConstraintsPreset.whenUnsatisfiable }}
{{- end }}
{{- end }}
{{- with .Values.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
Expand Down
24 changes: 22 additions & 2 deletions templates/proxy/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,28 @@ spec:
{{- with .Values.proxy.tolerations }}
tolerations: {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.proxy.topologySpreadConstraints }}
topologySpreadConstraints: {{- tpl (toYaml .) $ | nindent 8 }}
{{- if or .Values.proxy.topologySpreadConstraints .Values.proxy.topologySpreadConstraintsPreset.enabled }}
topologySpreadConstraints:
{{- if .Values.proxy.topologySpreadConstraints }}
{{- tpl (toYaml .Values.proxy.topologySpreadConstraints) $ | nindent 8 }}
{{- else }}
- labelSelector:
matchLabels:
{{- include "graphdb-proxy.selectorLabels" . | nindent 14 }}
matchLabelKeys:
- pod-template-hash
topologyKey: topology.kubernetes.io/zone
maxSkew: {{ .Values.proxy.topologySpreadConstraintsPreset.maxSkew }}
whenUnsatisfiable: {{ .Values.proxy.topologySpreadConstraintsPreset.whenUnsatisfiable }}
- labelSelector:
matchLabels:
{{- include "graphdb-proxy.selectorLabels" . | nindent 14 }}
matchLabelKeys:
- pod-template-hash
topologyKey: kubernetes.io/hostname
maxSkew: {{ .Values.proxy.topologySpreadConstraintsPreset.maxSkew }}
whenUnsatisfiable: {{ .Values.proxy.topologySpreadConstraintsPreset.whenUnsatisfiable }}
{{- end }}
{{- end }}
{{- with .Values.proxy.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
Expand Down
24 changes: 24 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,18 @@ tolerations: []
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
topologySpreadConstraints: []

# Default topology spread constraints preset ensuring GraphDB pods are spread across availability zones and nodes.
# When enabled and topologySpreadConstraints is empty, two constraints are generated:
# - Spread across availability zones (topology.kubernetes.io/zone)
# - Spread across nodes (kubernetes.io/hostname)
# Useful for cloud deployments on AWS/Azure/GCP with multiple availability zones.
# Note: topologySpreadConstraints takes precedence over this preset when set.
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
topologySpreadConstraintsPreset:
enabled: false
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway

##########################
# Resource Configuration #
##########################
Expand Down Expand Up @@ -1641,6 +1653,18 @@ proxy:
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
topologySpreadConstraints: []

# Default topology spread constraints preset ensuring GraphDB proxy pods are spread across availability zones and nodes.
# When enabled and topologySpreadConstraints is empty, two constraints are generated:
# - Spread across availability zones (topology.kubernetes.io/zone)
# - Spread across nodes (kubernetes.io/hostname)
# Useful for cloud deployments on AWS/Azure/GCP with multiple availability zones.
# Note: topologySpreadConstraints takes precedence over this preset when set.
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
topologySpreadConstraintsPreset:
enabled: false
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway

##########################
# Resource Configuration #
##########################
Expand Down