feat(ldap): Support reading bind username and password from secret #149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Changes
New Options
When
.Values.auth.ldap.bindCredentialSecret.name
is set, it is assumed thatauth.ldap.bindCredentialSecret.passwordKey
andauth.ldap.bindCredentialSecret.usernameKey
are also set. Instead of reading the plain text credentials, the environment variables will be set by reading from the k8s secret.Testing
Fire up minikube. I always delete and re-create. Up to you.
First, deploy the chart using the existing options. We will update to the secret after.
kubectl create secret generic bindplane \ --from-literal=license=$BINDPLANE_LICENSE
values.yaml
, Reach out to me for a values file as it contains sensitive values related to our ldap server.Once the pods are ready, try logging into the server.
kubectl port-forward bindplane-0 3011:3001
If it is working, try switching to a secret. Use the secret command I gave you, it will look similar to this but contain the real credentials for the dev ldap server.
kubectl create secret generic bindplane-ldap-bind \ --from-literal=username=REDACTED \ --from-literal=password='REDACTED'
Update the values.yaml file to use a secret.
Update the deployment. You should see the pods cycle.
Once the new BindPlane pod is running, inspect its environment and make sure it is referencing a secret for
BINDPLANE_LDAP_BIND_USER
andBINDPLANE_LDAP_BIND_PASSWORD
.It should look like this
Log into BindPlane again using the port-forwarding command and http://localhost:3011.
Please check that the PR fulfills these requirements