This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
[stable/mongodb-replicaset] Failing to create user from existing secret #2965
Labels
lifecycle/rotten
Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Is this a request for help?:
yes
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
similar to #2457
Version of Helm and Kubernetes:
minikube version:
v0.24.1
kubectl version:
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.4", GitCommit:"9befc2b8928a9426501d3bf62f72849d5cbcd5a3", GitTreeState:"clean", BuildDate:"2017-11-20T19:12:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
helm version:
Client: &version.Version{SemVer:"v2.7.2", GitCommit:"8478fb4fc723885b155c924d1c8c410b7a9444e6", GitTreeState:"clean"}
Which chart:
stable/mongodb-replicaset
What happened:
MongoDB admin user is not created when configuring
existingAdminSecret
from values.yml file.What you expected to happen:
MongoDB admin user exists in the database, and clients can successfully authenticate using the same credentials specified in the secret.
How to reproduce it (as minimally and precisely as possible):
Step 1: Create secret containing keys
user
andpassword
a)
echo -n "test" > user
b)
echo -n "test > password
c)
kubectl create secret generic mongo-cred --from-file=./user --from-file=./password
Step 2: Verify secret exists and contains correct keys
a)
kubectl get secret mongo-cred -o yaml
Step 3: Configure existingAdminSecret in values.yml
Step 4: Install chart
helm install -f values.yml stable/mongodb-replicaset
Step 5: Verify admin user exists and client can authenticate
a) shell into primary node
b) authenticate to mongo and call db.getUsers()
mongo admin -u test -p test --eval 'db.getUsers()'
Output:
Anything else we need to know:
I'm fairly new to Kubernetes and Helm, but I've done my best to research the issue and resolve on my own. Fortunately, I do have a few years' experience with MongoDB operations
As additional verification the user doesn't exist - I can successfully access mongo shell without credentials and manually create user named 'test'. If the user already existed, the command db.createUser() would fail.
User was successfully created when entering plain text values into the fields
adminUser
andadminPassword
invalues.yml
file.I inspected the secret auto-generated by the chart when supplying plain-text values, and the only substantive difference between that and my own secret were the labels. So, I additionally tried creating a secret with the same labels the chart-generated secret uses, but still the user was not created in the DB.
EDIT:
I was able to successfully use my existing secret when setting auth values via command line like so:
helm install --set auth.enabled=true,auth.existingAdminSecret=mongo-cred,auth.key=test stable/mongodb-replicaset
Problem persists however when I attempt to install from file using
helm install -f ...
The text was updated successfully, but these errors were encountered: