فهرست منبع

Merge branch 'joshuacox-FixingApiVersionInUsingSecrets' into release-1.5.0

Bertrand Gouny 5 سال پیش
والد
کامیت
6d34b3b4d5

+ 1 - 0
example/kubernetes/using-secrets/.gitignore

@@ -1 +1,2 @@
 ldap-secret.yaml
+ldap-deployment.yaml

+ 4 - 1
example/kubernetes/using-secrets/Makefile

@@ -5,10 +5,13 @@ ldap-secret.yaml: example
 	ENV_STARTUP_YAML=$(shell ${ENV_DIR}/file-to-base64.sh ${ENV_DIR}/my-env.startup.yaml) \
 	envsubst < ldap-secret.tpl > ldap-secret.yaml
 
-example: environment/my-env.startup.yaml environment/my-env.yaml
+example: environment/my-env.startup.yaml environment/my-env.yaml ldap-deployment.yaml
 
 environment/my-env.startup.yaml:
 	cd environment ; cp my-env.startup.yaml.example my-env.startup.yaml
 
 environment/my-env.yaml:
 	cd environment ; cp my-env.yaml.example my-env.yaml
+
+ldap-deployment.yaml:
+	cp ldap-deployment.yaml.example ldap-deployment.yaml

+ 22 - 0
example/kubernetes/using-secrets/README.md

@@ -1,3 +1,13 @@
+# Helm-chart
+
+After setting the variables you can get strange variables like:
+
+https://github.com/osixia/docker-openldap/issues/342
+
+I have found that using this helm chart does not have those issues:
+
+https://github.com/jp-gouin/helm-openldap.git
+
 # Generating ldap-secret.yaml
 
 `make example`
@@ -5,3 +15,15 @@
 Then edit the yaml files in the environment directory to have the desired paraneters, and then make the secret file:
 
 `make ldap-secret.yaml`
+
+And deploy the secret you just made:
+
+`kubectl apply -f ldap-secret.yaml`
+
+Apply the deployment yaml for ldap in k8s:
+
+`kubectl apply -f ldap-deployment.yaml`
+
+Finally apply the service yaml for ldap in k8s:
+
+`kubectl apply -f ldap-service.yaml`

+ 6 - 1
example/kubernetes/using-secrets/ldap-deployment.yaml → example/kubernetes/using-secrets/ldap-deployment.yaml.example

@@ -1,10 +1,13 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: ldap
   labels:
     app: ldap
 spec:
+  selector:
+    matchLabels:
+      app: ldap
   replicas: 1
   template:
     metadata:
@@ -29,6 +32,8 @@ spec:
           ports:
             - containerPort: 389
               name: openldap
+            - containerPort: 636
+              name: openldapssl
       volumes:
         - name: ldap-data
           hostPath:

+ 10 - 2
example/kubernetes/using-secrets/ldap-service.yaml

@@ -5,7 +5,15 @@ metadata:
     app: ldap
   name: ldap-service
 spec:
-  ports:
-    - port: 389
   selector:
     app: ldap
+  ports:
+    - protocol: TCP 
+      name: ldap
+      port: 389
+      targetPort: 389
+    - protocol: TCP 
+      name: ldapssl
+      port: 636
+      targetPort: 636
+