init
This commit is contained in:
127
templates/deployment.yaml
Normal file
127
templates/deployment.yaml
Normal file
@@ -0,0 +1,127 @@
|
||||
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: storage
|
||||
mountPath: "/config/"
|
||||
{{- 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 }}'
|
||||
{{- with .Values.volumes }}
|
||||
volumes:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- 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 }}
|
||||
Reference in New Issue
Block a user