apiVersion: apps/v1 kind: Deployment metadata: name: "{{ tpl .Values.identifier . }}" labels: app: openldap spec: replicas: 1 strategy: # Delete old pod before starting the new one - slapd doesn't react well # with two instances hitting the same database. type: "Recreate" selector: matchLabels: app: "{{ tpl .Values.identifier . }}-openldap" template: metadata: labels: app: "{{ tpl .Values.identifier . }}-openldap" spec: containers: - name: "openldap" image: "osixia/openldap:{{ .Chart.AppVersion }}" args: ["--loglevel", "info"] ports: - name: ldap containerPort: 389 protocol: TCP - name: ldaps containerPort: 636 protocol: TCP livenessProbe: tcpSocket: port: 389 initialDelaySeconds: 10 periodSeconds: 10 readinessProbe: tcpSocket: port: 389 initialDelaySeconds: 10 periodSeconds: 10 env: - name: HOSTNAME value: "{{ tpl .Values.fqdn . }}" - name: LDAP_LOG_LEVEL value: "{{ tpl .Values.ldapLogLevel . }}" - name: LDAP_ORGANISATION value: "{{ tpl .Values.ldapOrganisation . }}" - name: LDAP_DOMAIN value: "{{ tpl .Values.ldapDomain . }}" - name: LDAP_ADMIN_PASSWORD valueFrom: secretKeyRef: name: "{{ tpl .Values.identifier . }}-openldap" key: LDAP_ADMIN_PASSWORD volumeMounts: - name: "{{ tpl .Values.identifier . }}-openldap-data" mountPath: "/etc/ldap/slapd.d" subPath: configuration - name: "{{ tpl .Values.identifier . }}-openldap-data" mountPath: "/var/lib/ldap" subPath: database - name: "{{ tpl .Values.identifier . }}-openldap-data" mountPath: /container/service/slapd/assets/certs subPath: certs volumes: - name: "{{ tpl .Values.identifier . }}-openldap-data" persistentVolumeClaim: claimName: "{{ tpl .Values.identifier . }}-openldap-data"