Where can I get a list of Kubernetes API resources and subresources?

后端 未结 8 1637
庸人自扰
庸人自扰 2020-12-30 22:59

I am trying to configure Kubernetes RBAC in the least-permissive way possible and I want to scope my roles to specific resources and subresouces. I\'ve dug through the doc

相关标签:
8条回答
  • 2020-12-30 23:56

    Another option, especially for those who don't have immediate access to a live k8s, is the OpenAPI spec.
    From the api reference, you can reach the latest docs which has a link, at the top right, to the git managed OpenAPI spec which you can load at the Swagger live web editor.
    Endpoints like /api/v1/namespaces/{namespace}/pods/{name}/log will be listed there.

    Placed all these links in an attempt to future-proof this answer. I couldn't find a /latest type URL that'll point to the latest version.

    0 讨论(0)
  • 2020-12-31 00:02

    I wrote a tiny Go utility for this exact purpose. Generates a complete RBAC role with every possible resource & sub-resource on the cluster. You can then prune that back to fit your role's use case.

    https://github.com/coopernetes/kube-role-gen

    0 讨论(0)
提交回复
热议问题