In [7]:
from kubernetes import client, config

In [8]:
config.load_incluster_config()

In [9]:
v1=client.CoreV1Api()

In [10]:
for ns in v1.list_namespace().items:
    print ns.metadata.name


default
kube-system
kubeless

In [ ]:


In [ ]: