<p>Using Helm 3 installed OpenLDAP:</p>

<pre><code>helm install openldap stable/openldap
</code></pre>

<p>Got this message:</p>

<pre><code>NAME: openldap
LAST DEPLOYED: Sun Apr 12 13:54:45 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
OpenLDAP has been installed. You can access the server from within the k8s cluster using:

  openldap.default.svc.cluster.local:389


You can access the LDAP adminPassword and configPassword using:

  kubectl get secret --namespace default openldap -o jsonpath="{.data.LDAP_ADMIN_PASSWORD}" | base64 --decode; echo
  kubectl get secret --namespace default openldap -o jsonpath="{.data.LDAP_CONFIG_PASSWORD}" | base64 --decode; echo


You can access the LDAP service, from within the cluster (or with kubectl port-forward) with a command like (replace password and domain):
  ldapsearch -x -H ldap://openldap.default.svc.cluster.local:389 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w $LDAP_ADMIN_PASSWORD


Test server health using Helm test:
  helm test openldap


You can also consider installing the helm chart for phpldapadmin to manage this instance of OpenLDAP, or install Apache Directory Studio, and connect using kubectl port-forward.
</code></pre>

<p>However I can't use this command to search content on ldap server in the k8s cluster:</p>

<pre><code>export LDAP_ADMIN_PASSWORD=[REAL_PASSWORD_GET_ABOVE]
ldapsearch -x -H ldap://openldap.default.svc.cluster.local:389 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w $LDAP_ADMIN_PASSWORD
</code></pre>

<p>Got error</p>

<pre><code>ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
</code></pre>

<hr>

<p>I also login to the pod to run</p>

<pre><code>kubectl exec -it openldap -- /bin/bash
# export LDAP_ADMIN_PASSWORD=[REAL_PASSWORD_GET_ABOVE]
# ldapsearch -x -H ldap://openldap.default.svc.cluster.local:389 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w $LDAP_ADMIN_PASSWORD
</code></pre>

<p>The same.</p>

rawmain
<p>As it's stated in the notes:</p>

<blockquote>
  <p>NOTES:
  OpenLDAP has been installed. You can access the server from within the k8s cluster using:</p>
  
  <p><code>openldap.default.svc.cluster.local:389</code></p>
  
  <p>You can access the LDAP adminPassword and configPassword using:</p>
  
  <p><code>kubectl get secret --namespace default openldap -o jsonpath="{.data.LDAP_ADMIN_PASSWORD}" | base64 --decode; echo</code>
   <code>kubectl get secret --namespace default openldap -o jsonpath="{.data.LDAP_CONFIG_PASSWORD}" | base64 --decode; echo</code></p>
  
  <p>You can access the LDAP service, from within the cluster (or with <code>kubectl port-forward</code>) with a command like (replace password and domain):
   <code>ldapsearch -x -H ldap://openldap.default.svc.cluster.local:389 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w $LDAP_ADMIN_PASSWORD</code></p>
  
  <p>Test server health using Helm test:
   <code>helm test openldap</code></p>
  
  <p>You can also consider installing the helm chart for phpldapadmin to manage this instance of OpenLDAP, or install Apache Directory Studio, and connect using <code>kubectl port-forward</code>.</p>
</blockquote>

<p>You can do:</p>

<pre><code>$ kubectl port-forward services/openldap 3389:389 
Forwarding from 127.0.0.1:3389 -&gt; 389
Forwarding from [::1]:3389 -&gt; 389
Handling connection for 3389
</code></pre>

<p>From another shell, outside the Kubernetes cluster:</p>

<pre><code>$ kubectl get secret --namespace default openldap -o jsonpath="{.data.LDAP_ADMIN_PASSWORD}" | base64 --decode; echo
l3dkQByvzKKboCWQRyyQl96ulnGLScIx
$ ldapsearch -x -H ldap://localhost:3389 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w  l3dkQByvzKKboCWQRyyQl96ulnGLScIx
</code></pre>

<p>Also it was already mentioned in a comment by <a href="https://stackoverflow.com/users/1432893/totem" title="292 reputation">@Totem</a> </p>
