Listing all resources in a namespace

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

    All kubernetes objects are stored in etcd.

    All objects are stored in ETCD v3 the following way:

    /registry///
    

    I suggest just to take the list of all resources of some namespace from etcd v3 directly:

    ETCDCTL_API=3 etcdctl --endpoints=:2379 get / --prefix --keys-only | grep -E "^/\w+/\w+//+"
    

提交回复
热议问题