Last active
September 14, 2020 09:08
-
-
Save schneefisch/9638b0a212283c85f51ede11821ffd37 to your computer and use it in GitHub Desktop.
Basics for kubernetes-secrets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Secrets handling | |
# create secret | |
kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt | |
# get Secrets | |
kubectl get secrets | |
# get secret details | |
kubectl get secret mysecret -o yaml | |
# encode secret values | |
echo "asdfghjkl==" | base64 --decode | |
# copy secret to another namespace | |
kubectl get secrets -n old -o yaml | sed 's/namespace: old/namespace: new/' | kubectl create -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment