openldap

by jp-gouin

Helm chartv2.0.4App 2.4.47Verified publisher

Community developed LDAP software

About this chart

OpenLDAP Helm Chart

Prerequisites Details

  • Kubernetes 1.8+
  • PV support on the underlying infrastructure

Chart Details

This chart will do the following:

  • Instantiate 3 instances of OpenLDAP server with multi-master replication
  • A phpldapadmin to administrate the OpenLDAP server
  • ltb-passwd for self service password

Installing the Chart

To install the chart with the release name my-release:

$ git clone https://github.com/jp-gouin/helm-openldap.git
$ cd helm-openldap
$ helm install openldap .

Configuration

We use the docker images provided by https://github.com/osixia/docker-openldap. The docker image is highly configurable and well documented. Please consult to documentation for the docker image for more information.

The following table lists the configurable parameters of the openldap chart and their default values.

ParameterDescriptionDefault
replicaCountNumber of replicas3
strategyDeployment strategy{}
image.repositoryContainer image repositoryosixia/openldap
image.tagContainer image tag1.1.10
image.pullPolicyContainer pull policyIfNotPresent
extraLabelsLabels to add to the Resources{}
podAnnotationsAnnotations to add to the pod{}
existingSecretUse an existing secret for admin and config user passwords""
service.annotationsAnnotations to add to the service{}
service.externalIPsService external IP addresses[]
service.ldapPortExternal service port for LDAP389
service.ldapPortNodePortNodeport of External service port for LDAP if service.type is NodePortnil
service.loadBalancerIPIP address to assign to load balancer (if supported)""
service.loadBalancerSourceRangesList of IP CIDRs allowed access to load balancer (if supported)[]
service.sslLdapPortExternal service port for SSL+LDAP636
service.sslLdapPortNodePortNodeport of External service port for SSL if service.type is NodePortnil
service.typeService type can be ClusterIP, NodePort, LoadBalancerClusterIP
envList of key value pairs as env variables to be sent to the docker image. See https://github.com/osixia/docker-openldap for available ones[see values.yaml]
logLevelSet the container log level. Valid values: none, error, warning, info, debug, traceinfo
tls.enabledSet to enable TLS/LDAPS with custom certificate - should also set tls.secretfalse
tls.secretSecret containing TLS cert and key (eg, generated via cert-manager)""
tls.CA.enabledSet to enable custom CA crt file - should also set tls.CA.secretfalse
tls.CA.secretSecret containing CA certificate (ca.crt)""
adminPasswordPassword for admin user. Unset to auto-generate the passwordNone
configPasswordPassword for config user. Unset to auto-generate the passwordNone
customLdifFilesCustom ldif files to seed the LDAP server. List of filename -> data pairsNone
persistence.enabledWhether to use PersistentVolumes or notfalse
persistence.storageClassStorage class for PersistentVolumes.<unset>
persistence.accessModeAccess mode for PersistentVolumesReadWriteOnce
persistence.sizePersistentVolumeClaim storage size8Gi
resourcesContainer resource requests and limits in yaml{}
test.enabledConditionally provision test resourcesfalse
test.image.repositoryTest container image requires bats frameworkdduportal/bats
test.image.tagTest container tag0.4.0
replication.enabledEnable the multi-master replicationtrue
replication.retryretry period for replication in sec60
replication.timeouttimeout for replication in sec1
replication.starttlsstarttls replicationcritical
replication.tls_reqcerttls certificate validation for replicationnever
replication.intervalinterval for replication00:00:00:10
replication.clusterNameSet the clustername for replication"cluster.local"
phpldapadmin.enabledEnable the deployment of PhpLdapAdmintrue
phpldapadmin.ingressIngress of Phpldapadmin{}
phpldapadmin.envEnvironment variables for PhpldapAdmin{}
ltb-passwd.enabledEnable the deployment of Ltb-Passwdtrue
ltb-passwd.ingressIngress of the Ltb-Passwd service{}
ltb-passwd.ldapLdap configuration for the Ltb-Passwd service{}
ltb-passwd.envEnvironment variables for ltp-passwd{}

Specify each parameter using the --set key=value[,key=value] argument to helm install.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml stable/openldap

Tip: You can use the default values.yaml

PhpLdapAdmin

To enable PhpLdapAdmin set phpldapadmin.enabled to true

Ingress can be configure if you want to expose the service. Setup the env part of the configuration to access the OpenLdap server

Note : The ldap host should match the following namespace.Appfullname

Example :

phpldapadmin:
  enabled: true
  ingress:
    enabled: true
    annotations: {}
    path: /
    ## Ingress Host
    hosts:
    - phpldapadmin.local
  env:
    PHPLDAPADMIN_LDAP_HOSTS: openldap.openldap
     

Self-service-password

To enable Self-service-password set ltb-passwd.enabled to true

Ingress can be configure if you want to expose the service.

Setup the ldap part with the information of the OpenLdap server.

Set bindDN accordingly to your ldap domain

Note : The ldap server host should match the following ldap://namespace.Appfullname

Example :

ltb-passwd:
  enabled : true
  ingress:
    enabled: true
    annotations: {}
    host: "ssl-ldap2.local"
  ldap:
    server: ldap://openldap.openldap
    searchBase: dc=example,dc=org
    bindDN: cn=admin,dc=example,dc=org
    bindPWKey: LDAP_ADMIN_PASSWORD
  

Cleanup orphaned Persistent Volumes

Deleting the Deployment will not delete associated Persistent Volumes if persistence is enabled.

Do the following after deleting the chart release to clean up orphaned Persistent Volumes.

$ kubectl delete pvc -l release=${RELEASE-NAME}

Custom Secret

existingSecret can be used to override the default secret.yaml provided

Testing

Helm tests are included and they confirm connection to slapd.

helm install . --set test.enabled=true
helm test <RELEASE_NAME>
RUNNING: foolish-mouse-openldap-service-test-akmms
PASSED: foolish-mouse-openldap-service-test-akmms

It will confirm that we can do an ldapsearch with the default credentials

Deploy openldap with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has openldap on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartopenldap is pinned at v2.0.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply