Skip to content

Commit

Permalink
Adds support for setting up the LDAP server's admin user, admin passw…
Browse files Browse the repository at this point in the history
…ord and root DN (#125)

Co-authored-by: German Espinoza <[email protected]>
  • Loading branch information
gespinozat and German Espinoza authored Jul 3, 2024
1 parent 9b2d816 commit 57db6ad
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 27 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@ Once you have completed the above steps you can complete the file values.yaml to
| security.dexClientScope | Yes | Use "email openid profile offline_access groups" |
| security.gcpCredentials | No | JSON Credentials for Google Identity Authentication |
| security.caCerts | No | Custom CA certificates to be added at runtime |
| openldap.adminUser | Yes | LDAP deployment admin user |
| openldap.adminPass | Yes | LDAP deployment admin password |
| openldap.baseRoot | Yes | LDAP baseDN (or suffix) of the LDAP tree |
| openldap.image | Yes | LDAP deployment image repository |
| openldap.version | Yes | LDAP deployment image tag |
| openldap.imagePullSecrets | No | Secret used to pull images from private repository |
| openldap.podLabels | No | Pod labels for LDAP deployment |
| openldap.securityContext | No | Security context for LDAP deployment |
| openldap.containerSecurityContext | No | Container security context for LDAP deployment |
| storage.defaultStorage | No | Enable default storage using minio helm chart |
| storage.gcp.projectId | No | GCP Project Id for the storage |
| storage.gcp.bucketName | No | GCP Bucket name for the storage |
Expand Down
2 changes: 1 addition & 1 deletion charts/terrakube/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.17.4
version: 3.17.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
6 changes: 3 additions & 3 deletions charts/terrakube/templates/deployment-openldap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ spec:
image: {{ .Values.openldap.image }}:{{ .Values.openldap.version }}
env:
- name: LDAP_ADMIN_USERNAME
value: "admin"
value: {{ .Values.openldap.adminUser }}
- name: LDAP_ADMIN_PASSWORD
value: "admin"
value: {{ .Values.openldap.adminPass }}
- name: LDAP_ROOT
value: "dc=example,dc=org"
value: {{ .Values.openldap.baseRoot }}
- name: LDAP_CUSTOM_LDIF_DIR
value: "/ldifs"
ports:
Expand Down
44 changes: 22 additions & 22 deletions charts/terrakube/templates/secret-openldap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@ metadata:
type: Opaque
stringData:
config-ldap.ldif: |
dn: dc=example,dc=org
dn: {{ .Values.openldap.baseRoot }}
dc: example
objectClass: dcObject
objectClass: organization
o: Example, Inc
dn: ou=users,dc=example,dc=org
dn: ou=users,{{ .Values.openldap.baseRoot }}
ou: users
objectClass: organizationalunit
dn: cn=lester,ou=users,dc=example,dc=org
dn: cn={{ .Values.openldap.adminUser }},ou=users,{{ .Values.openldap.baseRoot }}
objectClass: inetOrgPerson
sn: Parkinson
cn: Lester
sn: Admin
cn: Admin
mail: [email protected]
userpassword: admin
userpassword: {{ .Values.openldap.adminPass }}
dn: cn=grady,ou=users,dc=example,dc=org
dn: cn=grady,ou=users,{{ .Values.openldap.baseRoot }}
objectClass: inetOrgPerson
sn: Chambers
cn: Grady
mail: [email protected]
userpassword: azure
userpassword: aws
dn: cn=saarah,ou=users,dc=example,dc=org
dn: cn=saarah,ou=users,{{ .Values.openldap.baseRoot }}
objectClass: inetOrgPerson
sn: Lott
cn: Saarah
mail: [email protected]
userpassword: aws
userpassword: azure
dn: cn=eugene,ou=users,dc=example,dc=org
dn: cn=eugene,ou=users,{{ .Values.openldap.baseRoot }}
objectClass: inetOrgPerson
sn: Monaghan
cn: Eugene
Expand All @@ -46,33 +46,33 @@ stringData:
# Group definitions.
dn: ou=Groups,dc=example,dc=org
dn: ou=Groups,{{ .Values.openldap.baseRoot }}
objectClass: organizationalUnit
ou: Groups
dn: cn=TERRAKUBE_ADMIN,ou=Groups,dc=example,dc=org
dn: cn=TERRAKUBE_ADMIN,ou=Groups,{{ .Values.openldap.baseRoot }}
objectClass: groupOfNames
cn: TERRAKUBE_ADMIN
member: cn=lester,ou=users,dc=example,dc=org
member: cn={{ .Values.openldap.adminUser }},ou=users,{{ .Values.openldap.baseRoot }}
dn: cn=TERRAKUBE_DEVELOPERS,ou=Groups,dc=example,dc=org
dn: cn=TERRAKUBE_DEVELOPERS,ou=Groups,{{ .Values.openldap.baseRoot }}
objectClass: groupOfNames
cn: TERRAKUBE_DEVELOPERS
member: cn=lester,ou=users,dc=example,dc=org
member: cn={{ .Values.openldap.adminUser }},ou=users,{{ .Values.openldap.baseRoot }}
dn: cn=AZURE_DEVELOPERS,ou=Groups,dc=example,dc=org
dn: cn=AZURE_DEVELOPERS,ou=Groups,{{ .Values.openldap.baseRoot }}
objectClass: groupOfNames
cn: AZURE_DEVELOPERS
member: cn=saarah,ou=users,dc=example,dc=org
member: cn=saarah,ou=users,{{ .Values.openldap.baseRoot }}
dn: cn=AWS_DEVELOPERS,ou=Groups,dc=example,dc=org
dn: cn=AWS_DEVELOPERS,ou=Groups,{{ .Values.openldap.baseRoot }}
objectClass: groupOfNames
cn: AWS_DEVELOPERS
member: cn=grady,ou=users,dc=example,dc=org
member: cn=grady,ou=users,{{ .Values.openldap.baseRoot }}
dn: cn=GCP_DEVELOPERS,ou=Groups,dc=example,dc=org
dn: cn=GCP_DEVELOPERS,ou=Groups,{{ .Values.openldap.baseRoot }}
objectClass: groupOfNames
cn: GCP_DEVELOPERS
member: cn=eugene,ou=users,dc=example,dc=org
member: cn=eugene,ou=users,{{ .Values.openldap.baseRoot }}
{{ end }}
5 changes: 4 additions & 1 deletion charts/terrakube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ security:

## OpenLdap
openldap:
imagePullSecrets: []
adminUser: "admin"
adminPass: "admin"
baseRoot: "dc=example,dc=org"
image: "bitnami/openldap"
version: "2.6.4-debian-11-r4"
imagePullSecrets: []
podLabels: {}
securityContext: {}
containerSecurityContext: {}
Expand Down

0 comments on commit 57db6ad

Please sign in to comment.