From 02009ea4a009470ff8665879d539dcdb654e8251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20GLON?= Date: Tue, 5 Dec 2023 09:55:19 +0100 Subject: [PATCH] fix --- charts/self-host/templates/admin.yaml | 2 +- charts/self-host/templates/api.yaml | 1 - charts/self-host/templates/attachments.yaml | 3 ++- charts/self-host/templates/events.yaml | 3 ++- charts/self-host/templates/helpers.tpl | 20 +++++++++---------- charts/self-host/templates/icons.yaml | 2 +- charts/self-host/templates/identity.yaml | 2 +- charts/self-host/templates/notifications.yaml | 2 +- .../post-install-db-migrator-job.yaml | 2 +- .../pre-install-db-migrator-job.yaml | 2 +- charts/self-host/templates/scim.yaml | 2 +- charts/self-host/templates/sso.yaml | 2 +- 12 files changed, 22 insertions(+), 21 deletions(-) diff --git a/charts/self-host/templates/admin.yaml b/charts/self-host/templates/admin.yaml index 1e4ed87a..7876138f 100644 --- a/charts/self-host/templates/admin.yaml +++ b/charts/self-host/templates/admin.yaml @@ -13,7 +13,6 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} replicas: 1 strategy: type: "{{ .Values.component.admin.deploymentStrategy }}" @@ -27,6 +26,7 @@ spec: app: {{ template "bitwarden.admin" . }} {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.admin.podServiceAccount }} serviceAccount: "{{ .Values.component.admin.podServiceAccount }}" serviceAccountName: "{{ .Values.component.admin.podServiceAccount }}" diff --git a/charts/self-host/templates/api.yaml b/charts/self-host/templates/api.yaml index 3aedd755..d01e1ab9 100644 --- a/charts/self-host/templates/api.yaml +++ b/charts/self-host/templates/api.yaml @@ -12,7 +12,6 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} replicas: 1 strategy: type: "{{ .Values.component.api.deploymentStrategy }}" diff --git a/charts/self-host/templates/attachments.yaml b/charts/self-host/templates/attachments.yaml index 7aa6a82c..f51089f3 100644 --- a/charts/self-host/templates/attachments.yaml +++ b/charts/self-host/templates/attachments.yaml @@ -12,7 +12,7 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} + replicas: 1 strategy: type: "{{ .Values.component.attachments.deploymentStrategy }}" @@ -26,6 +26,7 @@ spec: app.kubernetes.io/component: attachments {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.attachments.podServiceAccount }} serviceAccount: "{{ .Values.component.attachments.podServiceAccount }}" serviceAccountName: "{{ .Values.component.attachments.podServiceAccount }}" diff --git a/charts/self-host/templates/events.yaml b/charts/self-host/templates/events.yaml index ce2a8990..619f53dd 100644 --- a/charts/self-host/templates/events.yaml +++ b/charts/self-host/templates/events.yaml @@ -12,7 +12,7 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} + replicas: 1 strategy: type: "{{ .Values.component.events.deploymentStrategy }}" @@ -26,6 +26,7 @@ spec: app.kubernetes.io/component: events {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.events.podServiceAccount }} serviceAccount: "{{ .Values.component.events.podServiceAccount }}" serviceAccountName: "{{ .Values.component.events.podServiceAccount }}" diff --git a/charts/self-host/templates/helpers.tpl b/charts/self-host/templates/helpers.tpl index da8674e9..4d220881 100644 --- a/charts/self-host/templates/helpers.tpl +++ b/charts/self-host/templates/helpers.tpl @@ -65,7 +65,7 @@ app.kubernetes.io/name: {{ template "bitwarden.name" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} helm.sh/chart: {{ template "bitwarden.chart" . }} -{{- if eq (.Values.general.volumeAccessMode "ReadWriteOnce") }} +{{- if eq .Values.general.volumeAccessMode "ReadWriteOnce" }} app.kubernetes.io/storage: "ReadWriteOnce" {{- end -}} {{- if .Values.general.labels }} @@ -244,16 +244,16 @@ Name of SCIM components {{- define "bitwarden.podCoLocation.affinity" -}} -{{- if eq (.Values.general.volumeAccessMode "ReadWriteOnce") }} +{{- if eq .Values.general.volumeAccessMode "ReadWriteOnce" }} affinity: -podAffinity: + podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app.kubernetes.io/storage - operator: In - values: - - ReadWriteOnce - topologyKey: "kubernetes.io/hostname" + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/storage + operator: In + values: + - ReadWriteOnce + topologyKey: "kubernetes.io/hostname" {{- end -}} {{- end -}} diff --git a/charts/self-host/templates/icons.yaml b/charts/self-host/templates/icons.yaml index 7e433561..b69a810e 100644 --- a/charts/self-host/templates/icons.yaml +++ b/charts/self-host/templates/icons.yaml @@ -12,7 +12,6 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} replicas: 1 strategy: type: "{{ .Values.component.icons.deploymentStrategy }}" @@ -26,6 +25,7 @@ spec: app.kubernetes.io/component: icons {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.icons.podServiceAccount }} serviceAccount: "{{ .Values.component.icons.podServiceAccount }}" serviceAccountName: "{{ .Values.component.icons.podServiceAccount }}" diff --git a/charts/self-host/templates/identity.yaml b/charts/self-host/templates/identity.yaml index 5687d667..6a0fa933 100644 --- a/charts/self-host/templates/identity.yaml +++ b/charts/self-host/templates/identity.yaml @@ -12,7 +12,6 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} replicas: 1 strategy: type: "{{ .Values.component.identity.deploymentStrategy }}" @@ -26,6 +25,7 @@ spec: app.kubernetes.io/component: identity {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.identity.podServiceAccount }} serviceAccount: "{{ .Values.component.identity.podServiceAccount }}" serviceAccountName: "{{ .Values.component.identity.podServiceAccount }}" diff --git a/charts/self-host/templates/notifications.yaml b/charts/self-host/templates/notifications.yaml index d9f643e9..c9f07cb0 100644 --- a/charts/self-host/templates/notifications.yaml +++ b/charts/self-host/templates/notifications.yaml @@ -12,7 +12,6 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} replicas: 1 strategy: type: "{{ .Values.component.notifications.deploymentStrategy }}" @@ -26,6 +25,7 @@ spec: app.kubernetes.io/component: notifications {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.notifications.podServiceAccount }} serviceAccount: "{{ .Values.component.notifications.podServiceAccount }}" serviceAccountName: "{{ .Values.component.notifications.podServiceAccount }}" diff --git a/charts/self-host/templates/post-install-db-migrator-job.yaml b/charts/self-host/templates/post-install-db-migrator-job.yaml index 2608fabf..b611b084 100644 --- a/charts/self-host/templates/post-install-db-migrator-job.yaml +++ b/charts/self-host/templates/post-install-db-migrator-job.yaml @@ -16,7 +16,7 @@ spec: labels: app.kubernetes.io/component: post-install-db-migrator-job spec: - {{- if and (.Values.database.enabled) ( eq (.Values.general.volumeAccessMode "ReadWriteOnce") }} + {{- if and (.Values.database.enabled) ( eq .Values.general.volumeAccessMode "ReadWriteOnce") }} affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: diff --git a/charts/self-host/templates/pre-install-db-migrator-job.yaml b/charts/self-host/templates/pre-install-db-migrator-job.yaml index 39b41186..7e5f9c8a 100644 --- a/charts/self-host/templates/pre-install-db-migrator-job.yaml +++ b/charts/self-host/templates/pre-install-db-migrator-job.yaml @@ -20,7 +20,7 @@ spec: labels: app.kubernetes.io/component: pre-install-db-migrator-job spec: - {{- if and (.Values.database.enabled) ( eq (.Values.general.volumeAccessMode "ReadWriteOnce") }} + {{- if and (.Values.database.enabled) (eq .Values.general.volumeAccessMode "ReadWriteOnce") }} affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: diff --git a/charts/self-host/templates/scim.yaml b/charts/self-host/templates/scim.yaml index e6614896..93981c2e 100644 --- a/charts/self-host/templates/scim.yaml +++ b/charts/self-host/templates/scim.yaml @@ -12,7 +12,6 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} replicas: 1 strategy: type: "{{ .Values.component.scim.deploymentStrategy }}" @@ -26,6 +25,7 @@ spec: app.kubernetes.io/component: scim {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.scim.podServiceAccount }} serviceAccount: "{{ .Values.component.scim.podServiceAccount }}" serviceAccountName: "{{ .Values.component.scim.podServiceAccount }}" diff --git a/charts/self-host/templates/sso.yaml b/charts/self-host/templates/sso.yaml index 51c4fcdf..58f6a9ab 100644 --- a/charts/self-host/templates/sso.yaml +++ b/charts/self-host/templates/sso.yaml @@ -12,7 +12,6 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }} replicas: 1 strategy: type: "{{ .Values.component.sso.deploymentStrategy }}" @@ -26,6 +25,7 @@ spec: app.kubernetes.io/component: sso {{ include "bitwarden.labels" . | indent 8 }} spec: +{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }} {{- if .Values.component.sso.podServiceAccount }} serviceAccount: "{{ .Values.component.sso.podServiceAccount }}" serviceAccountName: "{{ .Values.component.sso.podServiceAccount }}"