Skip to content

Instantly share code, notes, and snippets.

@codespool
Created September 16, 2022 12:34
Show Gist options
  • Save codespool/b81b5d9ea526849ab1f2ec6d8aabdf13 to your computer and use it in GitHub Desktop.
Save codespool/b81b5d9ea526849ab1f2ec6d8aabdf13 to your computer and use it in GitHub Desktop.
Creating a kubernetes secret

From file:

kubectl create secret generic $SECRET_NAME --namespace=$NAMESPACE --from-file=./$FILE
  • file name will be the key, contents the value
  • multiple --from-file= blocks for multiple key-value pairs inside $SECRET_NAME
  • to rename the key, --from-file=NEW_KEY=./$FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment