From 9b62a6403b126dedea45182805e811569e1f714a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 15 Sep 2020 11:41:11 +0200 Subject: [PATCH] helm: fix affinity rules and resources --- helm/templates/web-deployment.yaml | 36 ++++++++++++++------------- helm/templates/worker-deployment.yaml | 36 ++++++++++++++------------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/helm/templates/web-deployment.yaml b/helm/templates/web-deployment.yaml index 2d9dbb322..783f41456 100644 --- a/helm/templates/web-deployment.yaml +++ b/helm/templates/web-deployment.yaml @@ -25,21 +25,23 @@ spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app.kubernetes.io/name - operator: In - values: - - {{ include "passbook.name" . }} - - key: app.kubernetes.io/instance - operator: In - values: - - {{ .Release.Name }} - - key: k8s.passbook.beryju.org/component - operator: In - values: - - web - topologyKey: "kubernetes.io/hostname" + - weight: 1 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "passbook.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: k8s.passbook.beryju.org/component + operator: In + values: + - web + topologyKey: "kubernetes.io/hostname" initContainers: - name: passbook-database-migrations image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" @@ -109,7 +111,7 @@ spec: resources: requests: cpu: 100m - memory: 200M + memory: 300M limits: cpu: 300m - memory: 350M + memory: 500M diff --git a/helm/templates/worker-deployment.yaml b/helm/templates/worker-deployment.yaml index c1774b54c..21aae23ca 100644 --- a/helm/templates/worker-deployment.yaml +++ b/helm/templates/worker-deployment.yaml @@ -25,21 +25,23 @@ spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app.kubernetes.io/name - operator: In - values: - - {{ include "passbook.name" . }} - - key: app.kubernetes.io/instance - operator: In - values: - - {{ .Release.Name }} - - key: k8s.passbook.beryju.org/component - operator: In - values: - - worker - topologyKey: "kubernetes.io/hostname" + - weight: 1 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "passbook.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: k8s.passbook.beryju.org/component + operator: In + values: + - worker + topologyKey: "kubernetes.io/hostname" containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" @@ -68,7 +70,7 @@ spec: resources: requests: cpu: 150m - memory: 300M + memory: 400M limits: cpu: 300m - memory: 500M + memory: 600M