fukuops/k8s/charts/lldap/templates/deployment.yaml

111 lines
3.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "fullname" . }}
labels:
{{- include "labels" . | nindent 4 }}
spec:
replicas: {{ .Values.lldap.replicaCount }}
selector:
matchLabels:
{{- include "selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.lldap.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.lldap.debug.enabled }}
initContainers:
- name: debug
image: alpine:3.19
command: ["sleep", "infinity"]
envFrom:
{{- if .Values.lldap.config }}
- configMapRef:
name: {{ include "fullname" . }}-config
{{- end }}
{{- if .Values.lldap.secret.existingSecretName }}
- secretRef:
name: {{ .Values.lldap.secret.existingSecretName }}
{{- end }}
{{- if .Values.lldap.persistence.enabled }}
volumeMounts:
- name: {{ include "pvcName" . }}
mountPath: /data
{{- end }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
capabilities:
drop:
- all
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.lldap.image.repository }}:{{ .Values.lldap.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.lldap.image.pullPolicy }}
{{- with .Values.lldap.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.lldap.service.httpPort }}
protocol: TCP
- name: ldap
containerPort: {{ .Values.lldap.service.ldapPort }}
protocol: TCP
envFrom:
{{- if .Values.lldap.config }}
- configMapRef:
name: {{ include "fullname" . }}-config
{{- end }}
{{- if .Values.lldap.secret.existingSecretName }}
- secretRef:
name: {{ .Values.lldap.secret.existingSecretName }}
{{- end }}
{{- if .Values.lldap.persistence.enabled }}
volumeMounts:
- name: {{ include "pvcName" . }}
mountPath: /data
{{- end }}
{{- with .Values.lldap.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if not .Values.lldap.debug.enabled }}
{{- with .Values.lldap.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.lldap.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.lldap.persistence.enabled }}
volumes:
- name: {{ include "pvcName" . }}
persistentVolumeClaim:
claimName: {{ include "pvcName" . }}
{{- else }}
volumes:
- name: {{ include "pvcName" . }}
emptyDir: {}
{{- end }}
{{- with .Values.lldap.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.lldap.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.lldap.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}