It would seem that there is no centralized way of finding an authoritative list of users on the "server" side (cluster), versus suggestions previously stated on this page of seeing which users an individual client has set in their .kube/config
file. As, the documentation states:
It is assumed that a cluster-independent service manages normal users [...] Kubernetes does not have objects which represent normal user accounts. Normal users cannot be added to a cluster through an API call.
https://kubernetes.io/docs/reference/access-authn-authz/authentication/
As far as I have been able to tell, the only reference to non-SA users appears to be when specifying "User" while defining RoleBinding
and ClusterRoleBinding
. However, my assumption is that since you cannot add a user through a normal API call, you most likely cannot get a list of 'users' from the API either. Again, "Kubernetes does not have objects which represent normal user accounts."
For what it is worth, ChatGPT suggested using kubectl get users
and kubectl get groups
. I am assuming it incorrectly picked up these suggestions from maybe this 2021 Rancher forum article (you will notice the kubectl 'get' command for what appears to be a period delineated CRD that begins with user.rancher.[...]
): https://forums.rancher.com/t/kubectl-command-to-return-a-list-of-all-user-accounts-from-rancher-security-accounts-users/36171
The answer given in that article also reinforces the concept from the K8s doc. In any case, as of v1.26, it appears the concept of 'users' is still deliberately detached from the Kubernetes control plane as much as possible.