From e0d6011f7d09734478b961dc415d13874f2e8ef8 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 25 Jun 2025 19:25:35 +0800 Subject: [PATCH] feat: add topologySpreadConstraints support --- charts/k8s-service/templates/_deployment_spec.tpl | 5 +++++ charts/k8s-service/values.yaml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/k8s-service/templates/_deployment_spec.tpl b/charts/k8s-service/templates/_deployment_spec.tpl index 11510f8..caac06e 100644 --- a/charts/k8s-service/templates/_deployment_spec.tpl +++ b/charts/k8s-service/templates/_deployment_spec.tpl @@ -461,6 +461,11 @@ spec: {{ toYaml . | indent 8 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.priorityClassName }} priorityClassName: {{ toYaml . | indent 8 }} diff --git a/charts/k8s-service/values.yaml b/charts/k8s-service/values.yaml index 223deb2..c411edb 100644 --- a/charts/k8s-service/values.yaml +++ b/charts/k8s-service/values.yaml @@ -682,11 +682,12 @@ secrets: {} # like: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ containerResources: {} -# nodeSelector and affinity specify restrictions on what node this pod should be scheduled on. +# nodeSelector, affinity and topologySpreadConstraints specify restrictions on what node this pod should be scheduled on. # NOTE: These variables are injected directly into the pod spec. See the official documentation for what this might look # like: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ nodeSelector: {} affinity: {} +topologySpreadConstraints: [] # priorityClassName assigns a priorityClass to the deployment allowing pods to preempt or be preempted. # See https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass