diff --git a/charts/qdrant/templates/statefulset.yaml b/charts/qdrant/templates/statefulset.yaml index 8b67de1..76b4797 100644 --- a/charts/qdrant/templates/statefulset.yaml +++ b/charts/qdrant/templates/statefulset.yaml @@ -211,7 +211,7 @@ spec: {{- end }} {{- with .Values.topologySpreadConstraints}} topologySpreadConstraints: - {{- toYaml . | nindent 8 }} + {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} serviceAccountName: {{ include "qdrant.fullname" . }} volumes: diff --git a/test/qdrant_topology-spread-constraints_test.go b/test/qdrant_topology-spread-constraints_test.go index c5c3a12..af12db1 100644 --- a/test/qdrant_topology-spread-constraints_test.go +++ b/test/qdrant_topology-spread-constraints_test.go @@ -25,7 +25,19 @@ func TestTopologySpreadConstraints(t *testing.T) { options := &helm.Options{ SetJsonValues: map[string]string{ - "topologySpreadConstraints": `[{"maxSkew":1,"topologyKey":"kubernetes.io/hostname","whenUnsatisfiable":"DoNotSchedule","labelSelector":{"matchLabels":{"app":"qdrant"}}}]`, + "topologySpreadConstraints": ` + [ + { + "maxSkew": 1, + "topologyKey": "topology.kubernetes.io/zone", + "labelSelector": { + "matchLabels": { + "app.kubernetes.io/name": "{{ include \"qdrant.name\" . }}" + } + }, + "whenUnsatisfiable": "DoNotSchedule" + } + ]`, }, KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName), }