Install OpenLDAP with DevStream

InstanceID Prefix

The instanceID prefix must be openldap, the minimum tools configuration example:

YAML

  1. tools:
  2. - name: helm-installer
  3. instanceID: openldap

Default Configs

keydefault valuedescription
chart.chartPath“”local chart path
chart.chartNamehelm-openldap/openldap-stack-hacommunity chart name
chart.version“”chart version
chart.timeout10mthis config will wait 5 minutes to deploy
chart.releaseNameopenldaphelm release name
chart.upgradeCRDstruedefault update CRD config
chart.namespaceopenldapnamespace where helm to deploy
chart.waittruewhether to wait until installation is complete
repo.urlhttps://jp-gouin.github.io/helm-openldap/helm repo address
repo.namehelm-openldaphelm repo name

Description of Key Fields in valuesYaml

  • replicaCount: The default value is 3, for the convenience of local testing, the above example is set to 1
  • service.type: The default value is ClusterIP, if you have services outside the Kubernetes cluster that require ldap integration, the value preferably be set to NodePort, so that services outside the Kubernetes cluster can access the ldap service via ldap://ip:389 instead of ldap://openldap.openldap-openldap-stack-ha:389
  • adminPassword: Use your own custom password
  • configPassword: Use your own custom password
  • ltb-passwd: Ingress of the Ltb-Passwd service by which you can modify your password. If you need this service, you can set ltb-passwd.enabled to true.
  • phpldapadmin.ingress: Ingress of Phpldapadmin service by which you can manage your ldap service. If you wish to expose the service to the Internet, you can change the phpldapadmin.ingress.enabled to true and configure your own domain name

Post-installation Operations

Once the installation is complete, you can manage ldap service through phpldapadmin. For local testing, you can access the service through port forwarding. The commands are as follows.

Bash

  1. kubectl port-forward svc/openldap-phpldapadmin 8080:80 -n openldap

Now you can now access the phpldapadmin service on your browser via http://127.0.0.1:8080

If you have not changed the default values in the above example, its account will be cn=admin,dc=devstream,dc=org and password will be Not@SecurePassw0rd.

Note: If you’re familiar with OpenLDAP, then you don’t need to continue reading the tutorial below, you can just go ahead and integrate ldap for your service.

Importing Your Data

The following is a sample file, if you have changed the above configuration, remember to replace dc=devstream,dc=org with your own.

Text Only

  1. dn: cn=admin,dc=devstream,dc=org
  2. cn: admin
  3. objectclass: organizationalRole
  4. dn: ou=Group,dc=devstream,dc=org
  5. cn: Group
  6. objectclass: organizationalRole
  7. ou: Group
  8. # confluence organizationalUnit
  9. dn: ou=confluence,ou=Group,dc=devstream,dc=org
  10. objectclass: organizationalUnit
  11. objectclass: top
  12. ou: confluence
  13. # confluence administrators group
  14. dn: cn=confluence-administrators,ou=confluence,ou=Group,dc=devstream,dc=org
  15. cn: confluence-administrators
  16. description:: d2lraeeuoeeQhue7hA==
  17. objectclass: groupOfUniqueNames
  18. uniquemember: uid=example,ou=People,dc=devstream,dc=org
  19. # confluence users group
  20. dn: cn=confluence-users,ou=confluence,ou=Group,dc=devstream,dc=org
  21. cn: confluence-users
  22. description:: d2lraeaZrumAmueUqOaItw==
  23. objectclass: groupOfUniqueNames
  24. uniquemember: uid=example,ou=People,dc=devstream,dc=org
  25. # jira organizationalUnit
  26. dn: ou=jira,ou=Group,dc=devstream,dc=org
  27. objectclass: organizationalUnit
  28. objectclass: top
  29. ou: jira
  30. # jira administrators Group
  31. dn: cn=jira-administrators,ou=jira,ou=Group,dc=devstream,dc=org
  32. cn: jira-administrators
  33. description:: amlyYeeuoeeQhue7hA==
  34. objectclass: groupOfUniqueNames
  35. uniquemember: uid=example,ou=People,dc=devstream,dc=org
  36. # jira users group
  37. dn: cn=jira-software-users,ou=jira,ou=Group,dc=devstream,dc=org
  38. cn: jira-software-users
  39. description:: amlyYeeuoeeQhue7hA==
  40. objectclass: groupOfUniqueNames
  41. uniquemember: uid=example,ou=People,dc=devstream,dc=org
  42. dn: ou=People,dc=devstream,dc=org
  43. objectclass: organizationalUnit
  44. ou: People
  45. # People for example
  46. dn: uid=example,ou=People,dc=devstream,dc=org
  47. cn: example
  48. gidnumber: 500
  49. givenname: example
  50. homedirectory: /home/example
  51. loginshell: /bin/sh
  52. mail: example@devstream.org
  53. objectclass: inetOrgPerson
  54. objectclass: posixAccount
  55. objectclass: top
  56. sn: example
  57. uid: example
  58. uidnumber: 1007
  59. userpassword: example@123456

Login your phpldapadmin service and import the sample configuration above.After importing the data successfully, the result is as follows.

Verify the LDAP Service

Log in to the container where the ldap service is located, and then use the ldapsearch command to query the user(uid=example,ou=people,dc=devstream,dc=org) created above

Bash

  1. root@openldap-openldap-stack-ha-0:/# ldapsearch -x -H ldap://127.0.0.1:389 -b uid=example,ou=people,dc=devstream,dc=org -D "cn=admin,dc=devstream,dc=org" -w Not@SecurePassw0rd
  2. # extended LDIF
  3. #
  4. # LDAPv3
  5. # base <uid=example,ou=people,dc=devstream,dc=org> with scope subtree
  6. # filter: (objectclass=*)
  7. # requesting: ALL
  8. #
  9. # example, People, devstream.org
  10. dn: uid=example,ou=People,dc=devstream,dc=org
  11. cn: example
  12. gidNumber: 500
  13. givenName: example
  14. homeDirectory: /home/example
  15. loginShell: /bin/sh
  16. mail: example@devstream.org
  17. objectClass: inetOrgPerson
  18. objectClass: posixAccount
  19. objectClass: top
  20. sn: example
  21. uid: example
  22. uidNumber: 1007
  23. userPassword:: ZXhhbXBsZUAxMjM0NTY=
  24. # search result
  25. search: 2
  26. result: 0 Success
  27. # numResponses: 2
  28. # numEntries: 1

If your command output is as above, your ldap service is fine. The above valuesYaml is only to facilitate your local testing, if you want production available, you also have to configure replicaCount, data persistence, etc., refer to OpenLDAP values.yaml