Answers: <pre><code>kubectl get sa --all-namespaces 
  </code></pre>
  <p>This will only provide the service accounts.</p>
  <p>In general, you can have a comma separated list of resources to display.</p>
  <p>Example:</p>
  <pre><code>kubectl get pods,svc,sa,deployments [-FLAGS]
  </code></pre>
  <p>The FLAGS would apply to all the resources.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-04-21T12:54:21.027Z
Answers: This is what I was looking for, and worked for me. Thanks!
Answers: mkumar118
Answers: CC BY-SA 4.0
Answers: 2019-08-29T13:21:48.413Z
Answers: 2024-08-02T11:21:52.640Z
Answers: 2024-08-02T11:21:52.640Z
Answers: tnsh
Answers: <p>The command you listed will show you your resources.</p>
  
  <p>Instead try: <code>kubectl get serviceAccounts</code></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-08-27T20:11:26.560Z
Answers: Is there a way to get everything? I actually want to see resources, service accounts, cluster role bindings, everything. I am trying to clean up my nodes and would appreciate a way to get a birds eye view.
Answers: David West
Answers: CC BY-SA 4.0
Answers: 2019-08-27T20:15:08.093Z
Answers: Are you trying to get all the information tied to that service account?  If so check out the official docs here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/.  Otherwise you may want to look into https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/ for a dashboard or chain commands together (e.g. kubectl get --all-namespaces && kubectl get serviceAccounts)
Answers: Wesley Rolnick
Answers: CC BY-SA 4.0
Answers: 2019-08-27T20:24:05.817Z
Answers: Popeye helps... https://github.com/derailed/popeye
Answers: David West
Answers: CC BY-SA 4.0
Answers: 2021-12-17T13:44:21.037Z
Answers: if your `serviceAccount` is not in your current `namespace` you should use `-A` for looking on all your `namespaces` or target an specific one with `-n=foobar` if you know in which `namespace` is your resource.
Answers: Juan-Kabbali
Answers: CC BY-SA 4.0
Answers: 2019-08-27T20:06:30.500Z
Answers: 2019-08-27T20:06:30.500Z
Answers: Wesley Rolnick
Body: <p>How do I show all service accounts In Kubernetes?</p>
  
  <p>I have tried <code>kubectl get --all-namespaces all</code>. It does not show service accounts.</p>
  
  <p>How can I use <code>kubectl</code> to list all service accounts?</p>
  
Tags: <kubernetes><kubectl><gcp>
Title: Kubernetes - How to show all service accounts
UserDisplayName: David West
ThreadText: # Kubernetes - How to show all service accounts
  
  (Asked by: username_0 on 2019-08-27)
  
  How do I show all service accounts In Kubernetes?
  
  I have tried `kubectl get --all-namespaces all`. It does not show service accounts.
  
  How can I use `kubectl` to list all service accounts?
  
  **Tags:** kubernetes, kubectl, gcp
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2019-08-27. Score: 16 | Accepted answer
  
  The command you listed will show you your resources.
  
  Instead try: `kubectl get serviceAccounts`
  
  > **Comments:**
  > **username_0**: Is there a way to get everything? I actually want to see resources, service accounts, cluster role bindings, everything. I am trying to clean up my nodes and would appreciate a way to get a birds eye view.  
  > **username_3**: Are you trying to get all the information tied to that service account?  If so check out the official docs here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/.  Otherwise you may want to look into https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/ for a dashboard or chain commands together (e.g. kubectl get --all-namespaces && kubectl get serviceAccounts)  
  > **username_0**: Popeye helps... https://github.com/derailed/popeye  
  > **username_4**: if your `serviceAccount` is not in your current `namespace` you should use `-A` for looking on all your `namespaces` or target an specific one with `-n=foobar` if you know in which `namespace` is your resource.  
  
  ---
  
  ### Answer by username_1 on 2019-08-29. Score: 10
  
  ```
  kubectl get sa --all-namespaces 
  
  ```
  
  This will only provide the service accounts.
  
  In general, you can have a comma separated list of resources to display.
  
  Example:
  
  ```
  kubectl get pods,svc,sa,deployments [-FLAGS]
  
  ```
  
  The FLAGS would apply to all the resources.
  
  > **Comments:**
  > **username_2**: This is what I was looking for, and worked for me. Thanks!  
  
  ---
  
  