Search code examples
kuberneteskubectl

How to get all the default user groups of a kubernetes cluster


Such as system:masterssystem:anonymoussystem:unauthenticated.

Is there a way to have all system groups that do not contain external creation, just the system,kubectl command or a list?

I searched the Kubernetes documentation but didn't find a list or a way to get it.


Solution

  • There is no build-in command to list all the default user groups from the Kubernetes cluster.

    However you can try to workaround in several options:

    • You can create your custom script (i.e. in Bash) based on kubectl get clusterrole command.
    • You can try install some plugins. Plugin rakkess could help you:

    Have you ever wondered what access rights you have on a provided kubernetes cluster? For single resources you can use kubectl auth can-i list deployments, but maybe you are looking for a complete overview? This is what rakkess is for. It lists access rights for the current user and all server resources, similar to kubectl auth can-i --list.

    See also more information about: