Difference between revisions of "Kind: Role"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
* <code>[[kind:]] Role</code> | * <code>[[kind:]] Role</code> | ||
+ | |||
+ | <pre> | ||
+ | cat << EoF > rbacuser-role.yaml | ||
+ | kind: Role | ||
+ | apiVersion: rbac.authorization.k8s.io/v1 | ||
+ | metadata: | ||
+ | namespace: rbac-test | ||
+ | name: pod-reader | ||
+ | rules: | ||
+ | - apiGroups: [""] # "" indicates the core API group | ||
+ | resources: ["pods"] | ||
+ | verbs: ["list","get","watch"] | ||
+ | - apiGroups: ["extensions","apps"] | ||
+ | resources: ["deployments"] | ||
+ | verbs: ["get", "list", "watch"] | ||
+ | EoF | ||
+ | </pre> | ||
== Related == | == Related == |
Revision as of 12:42, 4 October 2023
kind: Role
cat << EoF > rbacuser-role.yaml kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: namespace: rbac-test name: pod-reader rules: - apiGroups: [""] # "" indicates the core API group resources: ["pods"] verbs: ["list","get","watch"] - apiGroups: ["extensions","apps"] resources: ["deployments"] verbs: ["get", "list", "watch"] EoF
Related
See also
- Kubernetes roles,
kubectl get [ roles | clusterroles | clusterrolebindings ], kubectl create rolebinding
, K8s Cluster roles - Kubernetes RBAC
kubectl auth, kubectl auth can-i, kubectl auth reconcile
kubectl create [ role | clusterrole | clusterrolebinding
|rolebinding | serviceaccount ], groups:
, Kubernetes RBAC good practices,kube2iam
, K8s Cluster roles,rbac.authorization.k8s.io
,system:
Advertising: