2018年8月1日 | Leave a comment 问题: 解决: --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: openldap-config-pvc-dev spec: storageClassName: cbs accessModes: - ReadWriteOnce resources: requests: storage: 1Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: openldap-data-pvc-dev spec: storageClassName: cbs accessModes: - ReadWriteOnce resources: requests: storage: 10Gi --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: openldap-deploy-dev labels: app: openldap-dev spec: replicas: 1 template: metadata: labels: app: openldap-dev spec: containers: - name: openldap-dev image: osixia/openldap:1.2.1 volumeMounts: - name: ldap-data mountPath: /var/lib/ldap - name: ldap-config mountPath: /etc/ldap/slapd.d ports: - containerPort: 389 name: openldap env: - name: LDAP_LOG_LEVEL value: "256" - name: LDAP_ORGANISATION value: "test" - name: LDAP_DOMAIN value: "test.cn" - name: LDAP_ADMIN_PASSWORD value: "123456" - name: LDAP_CONFIG_PASSWORD value: "123456" - name: LDAP_TLS value: "false" volumes: - name: ldap-data persistentVolumeClaim: claimName: openldap-data-pvc-dev - name: ldap-config persistentVolumeClaim: claimName: openldap-config-pvc-dev --- apiVersion: v1 kind: Service metadata: labels: app: openldap-dev name: openldap-service-dev spec: type: NodePort ports: - port: 389 nodePort: 30389 selector: app: openldap-dev 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 ---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: openldap-config-pvc-devspec: storageClassName: cbs accessModes: - ReadWriteOnce resources: requests: storage: 1Gi ---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: openldap-data-pvc-devspec: storageClassName: cbs accessModes: - ReadWriteOnce resources: requests: storage: 10Gi---apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: openldap-deploy-dev labels: app: openldap-devspec: replicas: 1 template: metadata: labels: app: openldap-dev spec: containers: - name: openldap-dev image: osixia/openldap:1.2.1 volumeMounts: - name: ldap-data mountPath: /var/lib/ldap - name: ldap-config mountPath: /etc/ldap/slapd.d ports: - containerPort: 389 name: openldap env: - name: LDAP_LOG_LEVEL value: "256" - name: LDAP_ORGANISATION value: "test" - name: LDAP_DOMAIN value: "test.cn" - name: LDAP_ADMIN_PASSWORD value: "123456" - name: LDAP_CONFIG_PASSWORD value: "123456" - name: LDAP_TLS value: "false" volumes: - name: ldap-data persistentVolumeClaim: claimName: openldap-data-pvc-dev - name: ldap-config persistentVolumeClaim: claimName: openldap-config-pvc-dev ---apiVersion: v1kind: Servicemetadata: labels: app: openldap-dev name: openldap-service-devspec: type: NodePort ports: - port: 389 nodePort: 30389 selector: app: openldap-dev