diff --git a/kustomization.yaml b/kustomization.yaml new file mode 100644 index 0000000..c431be5 --- /dev/null +++ b/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openldap + +resources: +- ./resources/namespace.yaml +- ./resources/openldap.yaml +- ./resources/svc.yaml \ No newline at end of file diff --git a/resources/namespace.yaml b/resources/namespace.yaml new file mode 100644 index 0000000..2aa4176 --- /dev/null +++ b/resources/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: openldap \ No newline at end of file diff --git a/resources/openldap.yaml b/resources/openldap.yaml new file mode 100644 index 0000000..fd9453d --- /dev/null +++ b/resources/openldap.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: openldap + labels: + app.kubernetes.io/name: openldap + namespace: openldap +spec: + selector: + matchLabels: + app.kubernetes.io/name: openldap + replicas: 1 + template: + metadata: + labels: + app.kubernetes.io/name: openldap + spec: + containers: + - name: openldap + # image: docker.io/bitnami/openldap:latest + image: reg.cadoles.com/proxy_cache/library/openldap:latest + imagePullPolicy: "Always" + env: + - name: LDAP_ADMIN_USERNAME + value: "admin" + - name: LDAP_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + key: adminpassword + name: openldap + - name: LDAP_USERS + valueFrom: + secretKeyRef: + key: users + name: openldap + - name: LDAP_PASSWORDS + valueFrom: + secretKeyRef: + key: passwords + name: openldap + ports: + - name: tcp-ldap + containerPort: 1389 \ No newline at end of file diff --git a/resources/svc.yaml b/resources/svc.yaml new file mode 100644 index 0000000..0cabc36 --- /dev/null +++ b/resources/svc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: openldap + labels: + app.kubernetes.io/name: openldap + namespace: openldap +spec: + type: ClusterIP + ports: + - name: tcp-ldap + port: 1389 + targetPort: tcp-ldap + selector: + app.kubernetes.io/name: openldap \ No newline at end of file