From 795ab3d116e9feee012180e42366d89a302c4d30 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Thu, 30 Dec 2021 15:32:54 -0300 Subject: [PATCH] Try to schedule SAPL pod on same node as postgres --- charts/sapl/v0.2.0/templates/deployment.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/charts/sapl/v0.2.0/templates/deployment.yaml b/charts/sapl/v0.2.0/templates/deployment.yaml index 56cc123..fe56b44 100644 --- a/charts/sapl/v0.2.0/templates/deployment.yaml +++ b/charts/sapl/v0.2.0/templates/deployment.yaml @@ -124,6 +124,19 @@ spec: values: - {{ .Release.Name }} topologyKey: kubernetes.io/hostname + - weight: 50 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - postgresql + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + topologyKey: kubernetes.io/hostname {{- with .Values.affinity }} {{- toYaml . | nindent 8 }} {{- end }}