kubernetes 中的 RBAC 规则存在哪些 apiGroups 和资源?
What apiGroups and resources exist for RBAC rules in kubernetes?
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"]
在上面的示例中,我允许对 pods 和作业进行各种操作。
对于 pods,apiGroup 为空。对于作业,apiGroup 可以是批处理或扩展。
我在哪里可以找到所有可能的资源,以及我应该对每个资源使用哪个 apiGroup?
kubectl api-resources
将列出所有支持的资源类型和 api-group。这是 resource-types
的 table
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"]
在上面的示例中,我允许对 pods 和作业进行各种操作。 对于 pods,apiGroup 为空。对于作业,apiGroup 可以是批处理或扩展。 我在哪里可以找到所有可能的资源,以及我应该对每个资源使用哪个 apiGroup?
kubectl api-resources
将列出所有支持的资源类型和 api-group。这是 resource-types