Skip to content

Problem moving postgres password to secret #660

Discussion options

You must be logged in to vote

OK, I solved it. The problem was both username and password had a linefeed at the end of them. Once encoded into base64 it wasn't evident this LF was there. Both vim, nano and echo add linefeed to the end of files. It was harder than I thought to not add a line feed in an easy to remember way while also keeping the password out of history. This is what I came up with:

set HISTCONTROL="ignorespace"
 echo -n "myuser" > username
 echo -n "mypassword" > password
kubectl create secret generic db-user-pass --from-file=username=username --from-file=password=password
rm username password

OR

set HISTCONTROL="ignorespace"
 kubectl create secret generic db-user-pass --from-literal=username=myuser -…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@thesuperzapper
Comment options

Answer selected by MikeKulls2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants