- Notifications
You must be signed in to change notification settings - Fork1.2k
POSTGRES_USER env var can't be set using kubernetes secrets#1189
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Setup What happens: If I populate the POSTGRES_USER env variable with a hard coded value the install always succeeds and I can run psql -U $POSTGRES_USER Here two bits of my k8s manifest to compare: Not Working:
Working
What I expect to happen: I can hardly believe this and I'm happy to test anything you folks want to get to the bottom of it. It makes me wonder if the POSTGRES_USER needs to be populated really early in the deployment and there is some sort of race condition Lastly. I've used this method for building up k8s configs before, even on the postgres image. I have some running already in the same cluster. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 4 comments
-
I'm guessing you somehow already have an initialized data volume (this image will only initialize the volume if it isn't already initialized). Can you try making sure you absolutely have a definitely fresh data volume / folder and try again? |
BetaWas this translation helpful?Give feedback.
All reactions
-
i sure can. I run kubectl delete pvc -n $ns and $pvc and clears it. I suppose there is some possibility that some how on the backend the ceph volumes are getting reused but that would be wacky. I'll just change the name of the volume to be sure |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
So this is what I found:
|
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
+1, same here. (testing on kind version 0.24.0) works: env: -name:POSTGRES_USERvalue:psql-user doesn't: env: -name:POSTGRES_USERvalueFrom:secretKeyRef:name:env-secretskey:POSTGRES_USER secret: kind:Secretmetadata:name:env-secretstype:Opaquedata:POSTGRES_USER:ZGV2LXVzZXIK UPDATE: # with new line:~echo'ZGV2LXVzZXIK'| base64 -ddev-user# w/o new line:~echo'ZGV2LXVzZXI='| base64 -ddev-user% the problem is that working in console ~echo'dev-user'| base64ZGV2LXVzZXIK to send w/o the new line, the command should be: ~echo -n'dev-user'| base64ZGV2LXVzZXI= |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #1188 on January 24, 2024 21:25.