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

CSV support for ClusterRoles #473

Closed
darkowlzz opened this issue Sep 19, 2018 · 7 comments
Closed

CSV support for ClusterRoles #473

darkowlzz opened this issue Sep 19, 2018 · 7 comments

Comments

@darkowlzz
Copy link

StrategyDeploymentPermissions in CSV spec.install.spec.permissions supports specifying rules for RBAC Roles only, as per https://github.com/operator-framework/operator-lifecycle-manager/blob/master/pkg/controller/install/deployment.go#L78-L80 .

Is there a way to add ClusterRoles? I've an operator that needs access to node, persistentvolumeclaim and storageclass, which are cluster level access.

While deploying without OLM, for RBAC permissions, I create a ClusterRole and ClusterRoleBinding, and bind the ClusterRole to the ServiceAccount of my operator.

If this support can be added in the future, I can try implementing it and create a PR.

@ecordell
Copy link
Member

Hi @darkowlzz, support for creating ClusterRoles is coming very soon (~1wk).

@ecordell
Copy link
Member

See #477 for progress here

@ecordell
Copy link
Member

ecordell commented Oct 1, 2018

Forgot to come back and update this - ClusterRole support is in via the clusterPermissions block on the CSV.

@ecordell ecordell closed this as completed Oct 1, 2018
@wongma7
Copy link
Contributor

wongma7 commented Oct 4, 2018

this isn't working for me, any tips to debug? Added clusterPermissions to my csv, the field gets validated, but no clusterRoles nor clusterRoleBindings get created and installation proceeds then fails since the permissions aren't there. olm logs show nothing interesting: I tried grepping for this line

log.Infof("CSV %s permission met: %t", csv.GetName(), permissionsMet)
but found nothing

@njhale
Copy link
Member

njhale commented Oct 4, 2018

@wongma7 Are you installing your CSV via InstallPlan or by manually creating it? Creation of both permissions and clusterPermissions are now created via InstallPlans. Creating a CSV with permissions manually will only check if listed permissions (or RBAC equivalent permissions) exist.

@wongma7
Copy link
Contributor

wongma7 commented Oct 4, 2018

@njhale I'm manually creating it. So if I am understanding correctly, the InstallPlan would tell the Catalog Operator to create the clusterrole and clusterrolebinding the same way it can tell the Catalog Operator to create a CRD? will the clusterrole and clsuterrolebinding have a deterministic name so that i can make them required in my CSV?

@wongma7
Copy link
Contributor

wongma7 commented Oct 4, 2018

NVM about the name, I see now it doesn't change the manifest...asked because I noticed the roles created by OLM have some generated part at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants