2021-01-18 16:38:16 +00:00
|
|
|
{{- if eq .Values.persistence.type "deployment" }}
|
|
|
|
{{- $fullName := include "bitwarden.fullname" . -}}
|
2021-01-17 01:09:41 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2021-01-18 16:38:16 +00:00
|
|
|
name: {{ $fullName }}
|
2021-01-17 01:09:41 +00:00
|
|
|
labels:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- include "bitwarden.labels" . | nindent 4 }}
|
2021-01-17 01:09:41 +00:00
|
|
|
spec:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- if not .Values.autoscaling.enabled }}
|
2021-01-17 01:09:41 +00:00
|
|
|
replicas: {{ .Values.replicaCount }}
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- end }}
|
2021-01-17 01:09:41 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- include "bitwarden.selectorLabels" . | nindent 6 }}
|
2021-01-17 01:09:41 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- with .Values.podAnnotations }}
|
2021-01-17 01:09:41 +00:00
|
|
|
annotations:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
labels:
|
|
|
|
{{- include "bitwarden.selectorLabels" . | nindent 8 }}
|
2021-01-17 01:09:41 +00:00
|
|
|
spec:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ include "bitwarden.serviceAccountName" . }}
|
|
|
|
{{- with .Values.podSecurityContext }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2021-01-17 01:09:41 +00:00
|
|
|
containers:
|
2021-01-18 16:38:16 +00:00
|
|
|
- name: {{ $fullName }}
|
|
|
|
{{- with .Values.securityContext }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
2021-01-17 01:09:41 +00:00
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
2021-01-18 16:38:16 +00:00
|
|
|
envFrom:
|
|
|
|
- configMapRef:
|
|
|
|
name: {{ $fullName }}
|
2021-01-17 01:09:41 +00:00
|
|
|
env:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- with .Values.bitwarden.admin }}
|
|
|
|
{{- if and .enabled (not .disableAdminToken) }}
|
|
|
|
- name: ADMIN_TOKEN
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
{{- if .existingSecret.enabled }}
|
|
|
|
name: {{ .existingSecret.name | quote }}
|
|
|
|
key: {{ .existingSecret.tokenKey | quote }}
|
|
|
|
{{- else }}
|
|
|
|
name: {{ $fullName }}
|
|
|
|
key: admin-token
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.bitwarden.smtp }}
|
|
|
|
{{- if eq .enabled true }}
|
|
|
|
{{- if and .existingSecret.enabled (not .user) }}
|
|
|
|
- name: SMTP_USERNAME
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .existingSecret.name | quote }}
|
|
|
|
key: {{ .existingSecret.userKey | quote }}
|
|
|
|
- name: SMTP_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .existingSecret.name | quote }}
|
|
|
|
key: {{ .existingSecret.passwordKey | quote }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.bitwarden.yubico }}
|
|
|
|
{{- if and .enabled .existingSecret.enabled }}
|
|
|
|
- name: YUBICO_CLIENT_ID
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .existingSecret.name | quote }}
|
|
|
|
key: {{ .existingSecret.clientIdKey | quote }}
|
|
|
|
- name: YUBICO_SECRET_KEY
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .existingSecret.name | quote }}
|
|
|
|
key: {{ .existingSecret.secretKeyKey | quote }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- include "bitwarden.externalDatabaseEnv" . | nindent 12 }}
|
2021-01-17 01:09:41 +00:00
|
|
|
ports:
|
|
|
|
- name: http
|
2021-01-18 16:38:16 +00:00
|
|
|
containerPort: {{ .Values.bitwarden.gui.port }}
|
|
|
|
protocol: TCP
|
|
|
|
{{- if .Values.bitwarden.websockets.enabled }}
|
|
|
|
- name: websocket
|
|
|
|
containerPort: {{ .Values.bitwarden.websockets.port }}
|
2021-01-17 01:09:41 +00:00
|
|
|
protocol: TCP
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- end }}
|
2021-01-17 01:09:41 +00:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /
|
|
|
|
port: http
|
|
|
|
readinessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /
|
|
|
|
port: http
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- with .Values.resources }}
|
|
|
|
resources:
|
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
2021-01-17 01:09:41 +00:00
|
|
|
volumeMounts:
|
2021-01-18 16:38:16 +00:00
|
|
|
- name: {{ include "bitwarden.fullname" . }}
|
|
|
|
mountPath: /data
|
|
|
|
{{- with .Values.nodeSelector }}
|
2021-01-17 01:09:41 +00:00
|
|
|
nodeSelector:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
2021-01-17 01:09:41 +00:00
|
|
|
affinity:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
2021-01-17 01:09:41 +00:00
|
|
|
tolerations:
|
2021-01-18 16:38:16 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
volumes:
|
|
|
|
- name: {{ include "bitwarden.fullname" . }}
|
|
|
|
{{- if .Values.persistence.enabled }}
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim | quote }}{{- else }}{{ include "bitwarden.fullname" . }}{{- end }}
|
|
|
|
{{- else }}
|
|
|
|
emptyDir: {}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|