Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): no. kubectl get all --all-namespaces does not show all resources such as secrets.
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): "secrets", "all resources", "all types".
Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST
Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.6", GitCommit:"4bc5e7f9a6c25dc4c03d4d656f2cefd21540e28c", GitTreeState:"clean", B\
uildDate:"2017-09-14T06:55:55Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.6-gke.1", GitCommit:"407dbfe965f3de06b332cc22d2eb1ca07fb4d3fb", GitTreeState:"cl\
ean", BuildDate:"2017-09-27T21:21:34Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Environment: Google Container Engine
Details:
Cloud provider or hardware configuration:
uname -a):What happened:
kubectl get all --all-namespaces does not show all existing resources such as Secrets.
What you expected to happen:
kubectl get all --all-namespaces shows all existing resources such as Secrets as well as all resource types from other API servers.
How to reproduce it (as minimally and precisely as possible):
kubectl get all --all-namespaces
Anything else we need to know:
"all" should mean all the resources, not some of important resources.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale
/remove-lifecycle rotten
It is intended to not show Secrets when kubectl get all --all-namespaces
It is intended to not show Secrets when kubectl get all --all-namespaces
@mengqiy To confirm, we don't want to show Secrets with kubectl get all, right? The description of the issue says that we _should_ show Secrets...
I agree that Secrets should not be shown in kubectl get all. IIUC the current behavior is that Secrets are not shown so this can be closed now.
Would be nice to have, because kubectl get all doesn't show custom resources
kubectl get all doesn't show custom resources
This is now possible: https://github.com/kubernetes/kubernetes/pull/59561
@nikhita FYI https://github.com/kubernetes/community/blob/master/contributors/devel/kubectl-conventions.md#rules-for-extending-special-resource-alias---all
You may want to update it if it's not accurate for CRD.
You may want to update it if it's not accurate for CRD.
@mengqiy Sorry, missed the edit before. I think it is accurate for CRDs. kubectl get all doesn't show CRDs because they are cluster scoped resources. CRs don't follow that so it is possible to list them via kubectl get all.
https://github.com/kubernetes/kubernetes/pull/42873 provides the api-resources command that lists all available types
/close
I've found a few of these issues which are closed asking for more or less the same thing. Can we add a pointer to how to list ALL resources of ALL types? I'm diagnosing issues on K8 clusters where things generate more things and it gets hairy if there isn't a simple way to just list all of the things or see what all of the options are for things that can be out there.
in 1.11, https://github.com/kubernetes/kubernetes/pull/63254 added the ability to list all resource types in a format that can be used with kubectl get:
kubectl api-resources --verbs=list -o name | xargs -n 1 kubectl get -o name
this does not get things in all namespaces
this does not get things in all namespaces
you can add --all-namespaces if you want to get that
You may want to update it if it's not accurate for CRD.
@mengqiy Sorry, missed the edit before. I think it is accurate for CRDs.
kubectl get alldoesn't show CRDs because they are cluster scoped resources. CRs don't follow that so it is possible to list them viakubectl get all.
I still don't understand why kubectl get all --all-namespaces didn't show all custom resources? What is "CRs don't follow that so it is possible to list them via kubectl get all." mean? Which part of CRs in kubenetes possible to list ? Thx~
Doesn't kubectl api-resources work for you?
Doesn't
kubectl api-resourceswork for you?
The output of that is the list of all custom resource definitions that have been registered.
@workhardcc is wondering about kubectl get all which only (in my mind) would be expected to display all object including the ones that correspond to a custom resource. Right now, kubectl get all only shows the built-in Kubernetes resources, no CRD-defined resources.
For example: when you have cert-manager installed, kubectl get all does not show the Certificates or Orders that cert-manager stores.
Note: this issue is centered on listing object types, not object contents; maybe we should move that discussion to a new issue. I think https://github.com/kubernetes/kubectl/issues/151 talks about exactly that 馃檪
Why don't the kubectl api-resources and kubectl get crd commands return the same results?
Here is output of commands executed as a cluster admin user :
$ kubectl api-resources --verbs=list -o name | wc -l
140
$ kubectl get crd -o name | wc -l
82
@fredgate because not all resources are CRDs?
Most helpful comment
in 1.11, https://github.com/kubernetes/kubernetes/pull/63254 added the ability to list all resource types in a format that can be used with
kubectl get: