Difference between revisions of "Kind: Role"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
* <code>[[kind:]] Role</code>
 
* <code>[[kind:]] Role</code>
  
<pre>
+
* https://archive.eksworkshop.com/beginner/090_rbac/create_role_and_binding/
cat << EoF > rbacuser-role.yaml
+
 
kind: Role
+
cat << EoF > rbacuser-role.yaml
apiVersion: rbac.authorization.k8s.io/v1
+
kind: Role
metadata:
+
apiVersion: [[rbac.authorization.k8s.io/v1]]
  namespace: rbac-test
+
metadata:
  name: pod-reader
+
  namespace: rbac-test
rules:
+
  name: pod-reader
- apiGroups: [""] # "" indicates the core API group
+
rules:
  resources: ["pods"]
+
- apiGroups: [""] # "" indicates the core API group
  verbs: ["list","get","watch"]
+
  resources: ["pods"]
- apiGroups: ["extensions","apps"]
+
  verbs: ["list","get","watch"]
  resources: ["deployments"]
+
- apiGroups: ["extensions","apps"]
  verbs: ["get", "list", "watch"]
+
  resources: ["deployments"]
EoF
+
  verbs: ["get", "list", "watch"]
</pre>
+
EoF
 +
 
 +
 
 +
https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-example
  
 
== Related ==
 
== Related ==

Latest revision as of 11:18, 31 October 2023

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


https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-example

Related[edit]

See also[edit]

Advertising: