From 76c6e87a92caea10e7e32655739ff932b0a589c9 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Tue, 8 Mar 2022 10:24:03 -0300 Subject: [PATCH] Run edemocracia components on the same server --- .../templates/audienciasweb-deployment.yaml | 22 ++++++++++++++++--- .../audienciasworker-deployment.yaml | 22 ++++++++++++++++--- .../templates/discourse-deployment.yaml | 22 ++++++++++++++++--- .../templates/edemocracia-deployment.yaml | 2 ++ .../v0.4.0/templates/nginx-deployment.yaml | 20 ++++++++++++++--- .../templates/wikilegis-deployment.yaml | 22 ++++++++++++++++--- 6 files changed, 95 insertions(+), 15 deletions(-) diff --git a/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml b/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml index 4aeb4f5..7227d56 100644 --- a/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml @@ -7,11 +7,13 @@ metadata: labels: {{- include "edemocracia.labels" . | nindent 4 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb + app.kubernetes.io/component: audiencias spec: selector: matchLabels: {{- include "edemocracia.selectorLabels" . | nindent 6 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb + app.kubernetes.io/component: audiencias strategy: type: Recreate template: @@ -120,10 +122,24 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml b/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml index a96754d..e295f61 100644 --- a/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml @@ -7,11 +7,13 @@ metadata: labels: {{- include "edemocracia.labels" . | nindent 4 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker + app.kubernetes.io/component: audiencias spec: selector: matchLabels: {{- include "edemocracia.selectorLabels" . | nindent 6 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasworker + app.kubernetes.io/component: audiencias strategy: type: Recreate template: @@ -120,10 +122,24 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml b/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml index a63f962..1f3ec98 100644 --- a/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml @@ -11,6 +11,7 @@ spec: selector: matchLabels: {{- include "edemocracia.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: discourse io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse strategy: type: Recreate @@ -18,6 +19,7 @@ spec: metadata: labels: {{- include "edemocracia.selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: discourse io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse spec: {{- with .Values.imagePullSecrets }} @@ -117,10 +119,24 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml b/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml index 3aae7fe..c3c8177 100644 --- a/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml @@ -5,11 +5,13 @@ metadata: name: {{ include "edemocracia.fullname" . }}-edemocracia labels: {{- include "edemocracia.labels" . | nindent 4 }} + app.kubernetes.io/component: edemocracia io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia spec: selector: matchLabels: {{- include "edemocracia.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: edemocracia io.kompose.service: {{ include "edemocracia.fullname" . }}-edemocracia strategy: type: Recreate diff --git a/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml b/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml index 99ebc35..d957f4a 100644 --- a/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml @@ -96,10 +96,24 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml b/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml index da96d04..20ccb9e 100644 --- a/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml @@ -7,11 +7,13 @@ metadata: labels: {{- include "edemocracia.labels" . | nindent 4 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis + app.kubernetes.io/component: wikilegis spec: selector: matchLabels: {{- include "edemocracia.selectorLabels" . | nindent 6 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-wikilegis + app.kubernetes.io/component: wikilegis strategy: type: Recreate template: @@ -117,10 +119,24 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "edemocracia.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - edemocracia + topologyKey: kubernetes.io/hostname {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }}