How to list all namespaces in microk8s?

The command to get all namespaces in is:

microk8s kubectl get namespaces --all

Example:

[email protected]:~$ microk8s kubectl get namespaces --all
NAME              STATUS   AGE
kube-system       Active   9h
kube-public       Active   9h
kube-node-lease   Active   9h
default           Active   9h

Alternatively, you may use the -A parameter,

 microk8s kubectl get namespaces -A

To get more options or help, use the below command

microk8s kubectl get namespaces --help