4 changed files with 37 additions and 51 deletions
@ -1,49 +1,20 @@ |
|||||
- apiVersion: rbac.authorization.k8s.io/v1beta1 |
kind: ClusterRole |
||||
kind: ClusterRole |
apiVersion: v1 |
||||
metadata: |
metadata: |
||||
creationTimestamp: null |
name: hostpath-provisioner |
||||
labels: |
rules: |
||||
kubernetes.io/bootstrapping: rbac-defaults |
- apiGroups: [""] |
||||
name: system:persistent-volume-provisioner |
resources: ["persistentvolumes"] |
||||
rules: |
verbs: ["get", "list", "watch", "create", "delete"] |
||||
- apiGroups: |
- apiGroups: [""] |
||||
- "" |
resources: ["persistentvolumeclaims"] |
||||
resources: |
verbs: ["get", "list", "watch", "update"] |
||||
- persistentvolumes |
- apiGroups: ["storage.k8s.io"] |
||||
verbs: |
resources: ["storageclasses"] |
||||
- create |
verbs: ["get", "list", "watch"] |
||||
- delete |
- apiGroups: [""] |
||||
- get |
resources: ["events"] |
||||
- list |
verbs: ["list", "watch", "create", "update", "patch"] |
||||
- watch |
- apiGroups: [""] |
||||
- apiGroups: |
resources: ["services", "endpoints"] |
||||
- "" |
verbs: ["get"] |
||||
resources: |
|
||||
- persistentvolumeclaims |
|
||||
verbs: |
|
||||
- get |
|
||||
- list |
|
||||
- update |
|
||||
- watch |
|
||||
- apiGroups: |
|
||||
- storage.k8s.io |
|
||||
resources: |
|
||||
- storageclasses |
|
||||
verbs: |
|
||||
- get |
|
||||
- list |
|
||||
- watch |
|
||||
- apiGroups: |
|
||||
- "" |
|
||||
resources: |
|
||||
- events |
|
||||
verbs: |
|
||||
- watch |
|
||||
- apiGroups: |
|
||||
- "" |
|
||||
resources: |
|
||||
- events |
|
||||
verbs: |
|
||||
- create |
|
||||
- patch |
|
||||
- update |
|
||||
|
|||||
@ -0,0 +1,4 @@ |
|||||
|
apiVersion: v1 |
||||
|
kind: ServiceAccount |
||||
|
metadata: |
||||
|
name: hostpath-provisioner |
||||
@ -0,0 +1,7 @@ |
|||||
|
oc create -f service-account.yaml |
||||
|
oc create -f roles.yaml |
||||
|
# oc adm policy add-scc-to-user hostmount-anyuid system:serviceaccount:test-provisioner:hostpath-provisioner |
||||
|
# oc adm policy add-cluster-role-to-user hostpath-provisioner-runner system:serviceaccount:test-provisioner:hostpath-provisioner |
||||
|
|
||||
|
oc create -f pod.yaml |
||||
|
oc create -f class.yaml |
||||
Loading…
Reference in new issue