-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8s.rbac.yml
27 lines (27 loc) · 910 Bytes
/
k8s.rbac.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# allows a pod to create a pod
# applies to the default user in the default namespace!
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: default
name: pod-create-delete
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get", "watch", "list", "create","delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
# This role binding allows "default" to create and delete pods in the "default" namespace.
kind: RoleBinding
metadata:
name: read-pods
namespace: default
subjects:
# You can specify more than one "subject"
- kind: ServiceAccount
name: default # "name" is case sensitive
roleRef:
# "roleRef" specifies the binding to a Role / ClusterRole
kind: Role #this must be Role or ClusterRole
name: pod-create-delete # this must match the name of the Role or ClusterRole you wish to bind to
apiGroup: rbac.authorization.k8s.io