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?
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?
The command you listed will show you your resources.
Instead try: kubectl get serviceAccounts
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.
serviceAccountis not in your currentnamespaceyou should use-Afor looking on all yournamespacesor target an specific one with-n=foobarif you know in whichnamespaceis your resource. – Juan-Kabbali Dec 17 '21 at 13:44