Skip to content

Commit

Permalink
Merge pull request #4965 from mareklibra/v2v.non-admin.configmap
Browse files Browse the repository at this point in the history
kubevirt: add sample Role to grant privileges for non-admin to run v2v
  • Loading branch information
openshift-merge-robot committed Apr 14, 2020
2 parents bd18090 + 847a5e0 commit b270084
Showing 1 changed file with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: openshift-cnv
name: v2v-vmware-configmap-read
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["v2v-vmware"]
# resourceNames: ["v2v-vmware", "kubevirt-storage-class-defaults"] # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1784467
verbs: ["get", "watch"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
namespace: openshift-cnv
name: v2v-vmware-configmap-read
subjects:
# enable for all authenticated users
- kind: Group
name: system:authenticated
apiGroup: "rbac.authorization.k8s.io"
# Or enable for a named user only:
#- kind: User
# name: test # change to particular user who needs to run v2v
# apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: v2v-vmware-configmap-read
apiGroup: rbac.authorization.k8s.io

#####################################
# Following permissions are optional
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: kube-public
name: vmware-to-kubevirt-os-configmap-read
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["vmware-to-kubevirt-os"]
verbs: ["get", "watch"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
namespace: kube-public
name: vmware-to-kubevirt-os-configmap-read
subjects:
- kind: Group
name: system:authenticated
apiGroup: "rbac.authorization.k8s.io"
# Or enable for a named user only:
#- kind: User
# name: test # change to particular user who needs to run v2v
# apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: vmware-to-kubevirt-os-configmap-read
apiGroup: rbac.authorization.k8s.io

0 comments on commit b270084

Please sign in to comment.