Listing all resources in a namespace

前端 未结 9 1302
半阙折子戏
半阙折子戏 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:39

    This may not get all resources but it may be what someone is looking for

    kubectl get all,cm,secret,ing -A
    

    This seems to get most of the resources, prefixed with the type.

    At least, it gets:

    • pod
    • service
    • daemonset
    • deployment
    • replicaset
    • statefulset
    • job
    • configmap
    • secret
    • ingress

    This doesn't get custom resources but does get services.

    Else this does something similar:

    for i in `kubectl api-resources | awk '{print $1}'` do ; kubectl get $i
    

    Running v1.13

提交回复
热议问题