Skip to content

Instantly share code, notes, and snippets.

@steimntz
Last active August 5, 2019 20:26
Show Gist options
  • Save steimntz/b20c3bd17c89ab44f8bd2e9abc755029 to your computer and use it in GitHub Desktop.
Save steimntz/b20c3bd17c89ab44f8bd2e9abc755029 to your computer and use it in GitHub Desktop.
Change a Opaque secret in Kubernetes
MY_OLD_PASS="oldpass";
MY_NEW_PASS="newpass";
kubectl get secret sg -o yaml | sed -e "s,$(echo $MY_OLD_PASS | tr -d \\n | base64 -w 0),$(echo $MY_NEW_PASS | tr -d \\n | base64 -w 0)," | kubectl apply -f -;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment