Home > Software engineering >  Namespace resource listing in kubernetes
Namespace resource listing in kubernetes

Time:04-28

Can somebody please help me understand why is

kubectl get all --all-namespaces

lists resources from all namespaces but not Ingress. Even if I specify a particular namespace like the following I still don;t get the Ingress resource

kubectl get all -n app-space

Why do I have to specifically refer resource type [Ingress ] in this case If i have to get the list of all Ingress resources from all namespaces or a specific namespace

kubectl get ingress --all-namespaces
kubectl get ingress -n app-space

CodePudding user response:

kubectl get all is not intended to list all resources cause that would produce unexpected outputs, instead it's meant to list only some most used api resources. check the this Pull Request for the discussion.

CodePudding user response:

If you want to list all the API resources, then you can use:

kubectl api-resources

You can build further based on the above command, the below command will return the status of all the resources in "jenkins" namespace. you can change it as per your requirement.

for res in $(kubectl api-resources   -o name); 
do 
    kubectl get $res -n jenkins;
done
  • Related