-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4965 from mareklibra/v2v.non-admin.configmap
kubevirt: add sample Role to grant privileges for non-admin to run v2v
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
frontend/packages/kubevirt-plugin/integration-tests/data/role.v2v-vmware.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|