Skip to content

Get all service accounts using kubectl

To list all service accounts of a namespace we can use kubectl get serviceAccounts -n <namespace>

$ kubectl get serviceAccounts -n poopcodeapp
NAME      SECRETS   AGE
poopcode   1         4d3h
default   1         31d
Advertisements

To list all service accounts of all namespace we can use kubectl get serviceAccounts –all-namespaces

$ kubectl get serviceAccounts --all-namespaces
NAMESPACE         NAME                                     SECRETS   AGE
kube-node-lease   default                                  1         32d
kube-public       default                                  1         32d
kube-system       attachdetach-controller                  1         32d
kube-system       certificate-controller                   1         32d
kube-system       cloud-provider                           1         32d
kube-system       clusterrole-aggregation-controller       1         32d
kube-system       cronjob-controller                       1         32d
kube-system       daemon-set-controller                    1         32d
kube-system       default                                  1         32d
kube-system       deployment-controller                    1         32d
kube-system       disruption-controller                    1         32d
kube-system       endpoint-controller                      1         32d
kube-system       endpointslice-controller                 1         32d
kube-system       event-exporter-sa                        1         32d
kube-system       expand-controller                        1         32d
kube-system       fluentbit-gke                            1         32d
kube-system       generic-garbage-collector                1         32d
kube-system       gke-metadata-server                      1         32d
kube-system       gke-metrics-agent                        1         32d
kube-system       job-controller                           1         32d
kube-system       kube-dns                                 1         32d
kube-system       kube-dns-autoscaler                      1         32d
kube-system       kube-proxy                               1         32d
kube-system       metadata-agent                           1         32d
kube-system       metadata-proxy                           1         32d
kube-system       metrics-server                           1         32d
kube-system       namespace-controller                     1         32d
kube-system       netd                                     1         32d
kube-system       node-controller                          1         32d
kube-system       pdcsi-node-sa                            1         32d
kube-system       persistent-volume-binder                 1         32d
kube-system       pod-garbage-collector                    1         32d
kube-system       pv-protection-controller                 1         32d
kube-system       pvc-protection-controller                1         32d
kube-system       replicaset-controller                    1         32d
kube-system       replication-controller                   1         32d
kube-system       resourcequota-controller                 1         32d
kube-system       root-ca-cert-publisher                   1         32d
kube-system       service-account-controller               1         32d
kube-system       service-controller                       1         32d
kube-system       statefulset-controller                   1         32d
kube-system       ttl-controller                           1         32d
mongodb           default                                  1         32d
mongodb           mongodb-kubernetes-operator              1         31d

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.