Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubevirt: add sample Role to grant privileges for non-admin to run v2v #4965

Merged
merged 3 commits into from Apr 14, 2020
Merged

kubevirt: add sample Role to grant privileges for non-admin to run v2v #4965

merged 3 commits into from Apr 14, 2020

Conversation

mareklibra
Copy link
Contributor

@mareklibra mareklibra commented Apr 8, 2020

So far, the v2v controller deployment is still managed by the UI.
This is planed to be changed but recent state is like that.

To allow a non-admin user to run "Import VM" (v2v), read access
to the v2v-vmware configmap in the openshift-cnv namespace
needs to be granted.

This patch contains sample Role and RoleBinding objects to do so for
a named user.

In a nutshell, to grant access for a non-admin user, the admin needs to:

  • update/add the name of the user in the role.v2v-vmware.yaml
  • oc apply -f role.v2v-vmware.yaml

To verify, the non-admin user should get successful result for:

  • oc get configmap v2v-vmware -n openshift-cnv -o yaml

Permissions to access kubevirt-storage-class-defaults configmap were removed from this PR in favor of kubevirt/hyperconverged-cluster-operator#498 . However, the user needs to have read access to this configmap to be able to start v2v.

As a workaround till kubevirt/hyperconverged-cluster-operator#498 lands, corresponding row in the role.v2v-vmware.yaml can be uncommented.

So far, the v2v controller deployment is still managed by the UI.
This is planed to be changed but recent state is like that.

To allow a non-admin user to run "Import VM" (v2v), read access
to the `v2v-vmware` configmap in the `openshift-cnv` namespace
needs to be granted.

This patch conatins sample `Role` and `RoleBinding` objects to do so for
a named user.

In a nutshell, to grant access for a non-admin user, the admin needs to:
- update/add the name of the user in the `role.v2v-vmware.yaml`
- `oc apply -f role.v2v-vmware.yaml`

To verify, the non-admin user should get successful result for:
- `oc get configmap v2v-vmware -n openshift-cnv -o yaml`
@openshift-ci-robot openshift-ci-robot added component/kubevirt Related to kubevirt-plugin approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 8, 2020
@mareklibra
Copy link
Contributor Author

/retest

@mareklibra
Copy link
Contributor Author

Permissions for kubevirt-storage-class-defaults can be removed due to kubevirt/hyperconverged-cluster-operator#498 .

I will further change the example from a named-user to all authenticated users, while providing commented-out example for a named-user.

@mareklibra mareklibra changed the title kubevirt: add sample Role to grant privileges for non-admin to run v2v WIP kubevirt: add sample Role to grant privileges for non-admin to run v2v Apr 9, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2020
@mareklibra mareklibra changed the title WIP kubevirt: add sample Role to grant privileges for non-admin to run v2v kubevirt: add sample Role to grant privileges for non-admin to run v2v Apr 9, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2020
@mareklibra
Copy link
Contributor Author

/retest

@rawagner
Copy link
Contributor

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mareklibra, rawagner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2020
@openshift-merge-robot openshift-merge-robot merged commit b270084 into openshift:master Apr 14, 2020
@spadgett spadgett added this to the v4.5 milestone Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants