Files
librebooking_helm/templates/deployment.yaml

166 lines
6.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "librebooking.fullname" . }}
labels:
{{- include "librebooking.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "librebooking.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "librebooking.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.librebooking.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "librebooking.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.librebooking.image.repository }}:{{ .Values.librebooking.image.tag }}"
imagePullPolicy: {{ .Values.librebooking.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.librebooking.service.port }}
protocol: TCP
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: "/config/"
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
- name: uploads
mountPath: "/var/www/html/uploads"
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
env:
- name: LB_DB_HOST
{{- if eq .Values.mariadb.enabled true }}
value: {{ include "librebooking.mariadb.fullname" . }}
{{- else }}
value: {{ .Values.externalDatabase.host }}
{{- end }}
- name: LB_DB_USER
{{- if eq .Values.mariadb.enabled true }}
value: {{ .Values.mariadb.auth.username }}
{{- else }}
{{- if .Values.externalDatabase.existingSecretConfig.usernameField }}
valueFrom:
secretKeyRef:
name: {{ include "librebooking.databaseSecretName" . }}
key: {{ .Values.externalDatabase.existingSecretConfig.usernameField }}
{{- else}}
value: {{ .Values.externalDatabase.username }}
{{- end }}
{{- end }}
- name: LB_DB_USER_PWD
valueFrom:
secretKeyRef:
name: {{ include "librebooking.databaseSecretName" . }}
{{- if .Values.mariadb.enabled }}
key: mariadb-password
{{- else }}
key: {{ .Values.externalDatabase.existingSecretConfig.passwordField }}
{{- end }}
- name: LB_DB_NAME
{{- if eq .Values.mariadb.enabled true }}
value: {{ .Values.mariadb.auth.database }}
{{- else }}
{{- if .Values.externalDatabase.existingSecretConfig.databaseField }}
valueFrom:
secretKeyRef:
name: {{ include "librebooking.databaseSecretName" . }}
key: {{ .Values.externalDatabase.existingSecretConfig.databaseField}}
{{- else }}
value: {{ .Values.externalDatabase.database }}
{{- end }}
{{- end }}
- name: LB_INSTALL_PWD
value: '{{ .Values.librebooking.installPW }}'
- name: LB_LOG_LEVEL
value: '{{ .Values.librebooking.loglevel }}'
- name: LB_LOG_SQL
value: '{{ .Values.mariadb.loglevel }}'
- name: TZ
value: '{{ .Values.librebooking.TZ }}'
volumes:
- name: uploads
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaimUploads | default (printf "%s-uploads" (include "librebooking.fullname" .))}}
{{- else }}
emptyDir: {}
{{- end }}
- name: config
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaimConfig | default (printf "%s-config" (include "librebooking.fullname" .)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- range .Values.librebooking.extraVolumeMounts }}
- name: {{ .name }}
{{- if .existingClaim }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- else if .hostPath }}
hostPath:
path: {{ .hostPath }}
{{- else if .configMap }}
configMap:
name: {{ .configMap }}
{{- with .items }}
items:
{{- toYaml . | nindent 14 }}
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
{{- range .Values.librebooking.extraEmptyDirMounts }}
- name: {{ .name }}
emptyDir: {}
{{- end -}}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}