Skip to content

Commit 146a1d7

Browse files
authored
feat(chart): Support topology spread constraints (#26)
1 parent 42992ab commit 146a1d7

4 files changed

Lines changed: 66 additions & 0 deletions

File tree

deployments/helm/gate/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ externalSecrets:
626626
| `nodeSelector` | Node selector for pod scheduling | `{}` |
627627
| `tolerations` | Tolerations for pod scheduling | `[]` |
628628
| `affinity` | Affinity rules (includes pod anti-affinity by default) | See values.yaml |
629+
| `topologySpreadConstraints` | Topology spread constraints for distributing pods across nodes/zones | `[]` |
629630

630631
### Service parameters
631632

deployments/helm/gate/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,7 @@ spec:
181181
tolerations:
182182
{{- toYaml . | nindent 8 }}
183183
{{- end }}
184+
{{- with .Values.topologySpreadConstraints }}
185+
topologySpreadConstraints:
186+
{{- toYaml . | nindent 8 }}
187+
{{- end }}

deployments/helm/gate/values.schema.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,56 @@
367367
}
368368
}
369369
},
370+
"topologySpreadConstraints": {
371+
"type": "array",
372+
"description": "Topology spread constraints for distributing pods across nodes/zones",
373+
"items": {
374+
"type": "object",
375+
"properties": {
376+
"maxSkew": {
377+
"type": "integer",
378+
"minimum": 1
379+
},
380+
"topologyKey": {
381+
"type": "string"
382+
},
383+
"whenUnsatisfiable": {
384+
"type": "string",
385+
"enum": [
386+
"DoNotSchedule",
387+
"ScheduleAnyway"
388+
]
389+
},
390+
"labelSelector": {
391+
"type": "object"
392+
},
393+
"minDomains": {
394+
"type": "integer",
395+
"minimum": 1
396+
},
397+
"matchLabelKeys": {
398+
"type": "array",
399+
"items": {
400+
"type": "string"
401+
}
402+
},
403+
"nodeAffinityPolicy": {
404+
"type": "string",
405+
"enum": [
406+
"Honor",
407+
"Ignore"
408+
]
409+
},
410+
"nodeTaintsPolicy": {
411+
"type": "string",
412+
"enum": [
413+
"Honor",
414+
"Ignore"
415+
]
416+
}
417+
}
418+
}
419+
},
370420
"service": {
371421
"type": "object",
372422
"description": "Kubernetes Service configuration",

deployments/helm/gate/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,17 @@ tolerations: []
143143

144144
affinity: {}
145145

146+
# Topology spread constraints for distributing pods across nodes/zones.
147+
# Example (soft spread across nodes, never blocks scheduling):
148+
# topologySpreadConstraints:
149+
# - maxSkew: 1
150+
# topologyKey: kubernetes.io/hostname
151+
# whenUnsatisfiable: ScheduleAnyway
152+
# labelSelector:
153+
# matchLabels:
154+
# app.kubernetes.io/name: gate
155+
topologySpreadConstraints: []
156+
146157
# -----------------------------------------------------------------------------
147158
# Service configuration
148159
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)