Created
November 29, 2018 03:07
-
-
Save gregjhogan/0e80e687f5cfbd68eef0537e87f7dd24 to your computer and use it in GitHub Desktop.
kubernetes sdk python get secret using client from cli credentials
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
| from base64 import b64decode | |
| from kubernetes import client, config | |
| config.load_kube_config() | |
| v1 = client.CoreV1Api() | |
| secret = v1.read_namespaced_secret('<secret-name>', 'default') | |
| value = b64decode(secret.data["<property-name>"]) | |
| print(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment