apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: lldap
  name: lldap
spec:
  replicas: 1
  selector:
    matchLabels:
      app: lldap
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: lldap
    spec:
      containers:
        - env:
            - name: GID
              value: "1001"
            - name: LLDAP_JWT_SECRET
              valueFrom:
                secretKeyRef:
                  name: lldap-credentials
                  key: jwt-secret
            - name: LLDAP_LDAP_BASE_DN
              valueFrom:
                secretKeyRef:
                  name: lldap-credentials
                  key: base-dn
            - name: LLDAP_LDAP_USER_PASS
              valueFrom:
                secretKeyRef:
                  name: lldap-credentials
                  key: ldap-user-pass
            - name: TZ
              value: Europe/Berlin
            - name: UID
              value: "1001"
          image: lldap
          name: lldap
          ports:
            - containerPort: 3890
            - containerPort: 17170
          volumeMounts:
            - mountPath: /data
              name: lldap-data
      restartPolicy: Always
      volumes:
        - name: lldap-data
          persistentVolumeClaim:
            claimName: lldap-data