Created
November 3, 2021 09:49
-
-
Save louwersj/b14a4205c68f5d272b708c9e7a830061 to your computer and use it in GitHub Desktop.
This file contains 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 kubernetes import client, config | |
# Load the connection config, default behaviour is to load ~/.kube/config | |
# For development this is fine, when moving into production another way | |
# of providing the config is required | |
config.load_kube_config() | |
v1 = client.CoreV1Api() | |
nameSpaceList = v1.list_namespace() | |
for nameSpace in nameSpaceList.items: | |
print(nameSpace.metadata.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment