kind: Deployment
apiVersion: apps/v1
metadata:
  name: openldap
  labels:
    app: openldap
spec:
  replicas: 1
  selector:
    matchLabels:
      app: openldap
  template:
    metadata:
      labels:
        app: openldap
    spec:
      restartPolicy: Always
      serviceAccountName: openldap
      serviceAccount: openldap
      schedulerName: default-scheduler
      terminationGracePeriodSeconds: 30
      securityContext: {}
      containers:
        - resources:
            limits:
              cpu: "5m"
              memory: "60Mi"
          readinessProbe:
            exec:
              command:
                - /bin/bash
                - '-c'
                - exit 0
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          name: openldap
          command:
            - /container/tool/run
#            - --copy-service
#            - --log-level
#            - debug
          livenessProbe:
            exec:
              command:
                - /bin/bash
                - '-c'
                - exit 0
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          env:
            - name: LDAP_DOMAIN
              value: szesto.com
            - name: LDAP_ADMIN_PASSWORD
              value: admin
            - name: LDAP_CONFIG_PASSWORD
              value: admin
            - name: LDAP_ENABLE_PORT_389
              value: 'true'
            - name: LDAP_LOG_LEVEL
              value: '-1'
            - name: LDAP_SEED_INTERNAL_LDIF_PATH
              value: /etc/zorro
          ports:
            - containerPort: 636
              protocol: TCP
            - containerPort: 389
              protocol: TCP
          imagePullPolicy: Always
          terminationMessagePolicy: File
          image: 'ibmcom/isam-openldap:latest'
          volumeMounts:
#            - mountPath: /container/service/slapd/assets/config/bootstrap/ldif/custom/bootstrap.ldif
            - mountPath: /etc/zorro
              name: bootstrap-ldif
      volumes:
        - name: bootstrap-ldif
          configMap:
            name: bootstrap-ldif
        - name: ldaplib
          emptyDir: {}
        - name: ldapslapd
          emptyDir: {}
        - name: ldapsecauthority
          emptyDir: {}
      dnsPolicy: ClusterFirst
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
