Question
How can I use ldapvi in my Nubus/OpenDesk Environment?
Advance notice
Please keep in mind, that the prefix (ums-) possibly needs to be adjusted depending on the environment
Answer
ldapvi is not installed by default on the LDAP server pods. A simple approach is to use a temporary debug container.
$ kubectl apply -n ${NAMESPACE?} -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: ldap-debug
spec:
restartPolicy: Never
containers:
- name: debug
image: alpine
command: ["sh","-c","sleep infinity"]
envFrom:
- configMapRef:
name: ums-ldap-server-primary
- secretRef:
name: ums-ldap-server-admin
EOF
Next, the corresponding debug pod needs to be prepared, ldapvi and an editor of your choice installed:
$ kubectl exec -n ${NAMESPACE?} ldap-debug -i -t -- sh
apk add ldapvi vim
[…]
export EDITOR=vim
export VISUAL=vim
Afterwards, the debug pod is ready to use and you can access ldapvi as follows within the debug-pod:
$ ldapvi --host ums-ldap-server-primary -D "$ADMIN_DN" -w "$password" -b "$LDAP_BASEDN"
Cleanup
After finishing the manual adjustments, you can simply remove the debug pod with the following command:
$ kubectl delete pod -n ${NAMESPACE?} ldap-debug