Listing all resources in a namespace

前端 未结 9 1276
半阙折子戏
半阙折子戏 2020-12-07 20:24

I would like to see all resources in a namespace.

Doing kubectl get all will, despite of the name, not list things like services and ingresses.

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 20:48

    Based on this comment , the supported way to list all resources is to iterate through all the api versions listed by kubectl api-resources:

    kubectl api-resources enumerates the resource types available in your cluster.

    this means you can combine it with kubectl get to actually list every instance of every resource type in a namespace:

    kubectl api-resources --verbs=list --namespaced -o name \
      | xargs -n 1 kubectl get --show-kind --ignore-not-found -l 

提交回复
热议问题