Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sebglon committed Dec 5, 2023
1 parent 6e484b2 commit 4301700
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion charts/self-host/templates/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}
replicas: 1
strategy:
type: "{{ .Values.component.admin.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/self-host/templates/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}
replicas: 1
strategy:
type: "{{ .Values.component.api.deploymentStrategy }}"
Expand All @@ -26,6 +25,7 @@ spec:
app.kubernetes.io/component: api
{{ include "bitwarden.labels" . | indent 8 }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 6 }}
{{- if .Values.component.api.podServiceAccount }}
serviceAccount: "{{ .Values.component.api.podServiceAccount }}"
serviceAccountName: "{{ .Values.component.api.podServiceAccount }}"
Expand Down
3 changes: 2 additions & 1 deletion charts/self-host/templates/attachments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}

replicas: 1
strategy:
type: "{{ .Values.component.attachments.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down
3 changes: 2 additions & 1 deletion charts/self-host/templates/events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}

replicas: 1
strategy:
type: "{{ .Values.component.events.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down
22 changes: 11 additions & 11 deletions charts/self-host/templates/helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/storage
operator: In
values:
- ReadWriteOnce
topologyKey: "kubernetes.io/hostname"
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/storage
operator: In
values:
- ReadWriteOnce
topologyKey: "kubernetes.io/hostname"
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/self-host/templates/icons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}
replicas: 1
strategy:
type: "{{ .Values.component.icons.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/self-host/templates/identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}
replicas: 1
strategy:
type: "{{ .Values.component.identity.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/self-host/templates/notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}
replicas: 1
strategy:
type: "{{ .Values.component.notifications.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/self-host/templates/scim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}
replicas: 1
strategy:
type: "{{ .Values.component.scim.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/self-host/templates/sso.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{ include "bitwarden.podCoLocation.affinity" . | indent 2 }}
replicas: 1
strategy:
type: "{{ .Values.component.sso.deploymentStrategy }}"
Expand All @@ -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 }}"
Expand Down

0 comments on commit 4301700

Please sign in to comment.