<p>I am looking to output a comma separated list of all user accounts from Kubernetes.</p>
<p>I understand that one can return a list of namespaces, pods, and so on from Kubernetes using the 'kubectl get namespace' and 'kubectl get pods' command. However, is there an equivalent for returning a list of Kubernetes users?</p>
<p>Currently, I can see a list of all of the user account and their respective names, emails, and IDs from within Kubernetes via our management platform Rancher but, the problem is, I can't seem to find a way to return a comma-separated list of these users via the command line through Kubectl or Powershell.</p>

<p>This really depends on your k8s setup and rbac model.</p>
<p>I would suggest that you look at the objects talked about here <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/rbac/</a></p>
<p>In the end, the commands you probably want are:</p>
<pre><code>kubectl get clusterroles.rbac.authorization.k8s.io --all-namespaces
kubectl get roles.rbac.authorization.k8s.io --all-namespaces
</code></pre>
