What apiGroups and resources exist for RBAC rules in kubernetes?
Asked Answered
S

2

14
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  namespace: xi-{{instanceId}}
  name: deployment-creation
rules:
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["batch", "extensions"]
  resources: ["jobs"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

In the above example, I permit various operations on pods and jobs. For pods, the apiGroup is blank. For jobs, the apiGroup may be batch or extensions. Where can I find all the possible resources, and which apiGroup I should use with each resource?

Sheerness answered 30/5, 2019 at 10:26 Comment(0)
G
21

kubectl api-resources will list all the supported resource types and api-group. Here is the table of resource-types

Grip answered 30/5, 2019 at 10:32 Comment(2)
The linked document specifies the apiGroup column in the place where kubectl api-resources specifies the apiVersion column and they differ, which is confusing. Anyway able to disspell?Fifty
former comment addressed in github.com/kubernetes/website/issues/35206Fifty
U
2

just to add to @suresh's answer, here is a list of apiGroups

Unpromising answered 6/10, 2022 at 0:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.