Skip to content

Update RBAC best practices - #3408

Merged
prydonius merged 1 commit into
helm:masterfrom
unguiculus:feature/rbac
Jan 30, 2018
Merged

prydonius merged 1 commit into
helm:masterfrom
unguiculus:feature/rbac

Conversation

@unguiculus

Copy link
Copy Markdown
Member

This revises our RBAC best practices based on a discussion that came up there: cert-manager/cert-manager#229.

cc @kubernetes/charts-maintainers @omkensey

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 27, 2018
@omkensey

Copy link
Copy Markdown

I don’t like using the “default” service account if rbac.create is false and no service account is specified — we should still generate a name then. Our assumption in that case is that the user is either not using RBAC at all, or self-managing it. In the latter case it doesn’t matter for RBAC purposes what service account name is used; in the former, a newly-generated account will be easier to manage later — a user wanting to give a chart-installed app specific permissions would have to either patch it to use a different account (that they have to generate themselves to boot), or grant the desired permissions to the default account (potentially dangerous).

If users do want to self-manage and use the default service account, that’s still easily done by setting rbac.create to false and the account name to “default”.

@unguiculus

unguiculus commented Jan 27, 2018 •

Copy link
Copy Markdown
Member Author

I think this is fine and reflects that the default service account is used if you don't specify a service account at all on a resource. BTW, this is not related to rbac.create any more. As you suggested, service account and RBAC are now configured independently. If serviceAccount.create is false, the default service account is used if no service account is configured. I think this is reasonable and the user has the option to specify a dedicated service account if they like.

@omkensey

Copy link
Copy Markdown

Ah, you’re right. That’s what I get for reading on mobile while distracted :) Yes, this looks good to me.

@prydonius

Copy link
Copy Markdown
Member

Thanks for writing this up @unguiculus!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 29, 2018
@prydonius

Copy link
Copy Markdown
Member

Thought this was in the charts repo and would automerge, my bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants