You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In discussion of a Jetstack PR, I have come to believe we need to at least update the best practices doc for RBAC in charts, and possibly refactor those practices.
The bit that needs updating is the current assertion that "serviceAccountName is effectively a required value". It should be optional, but generated to a unique name if not specified.
However, additional cases not handled by the current practice are:
a service account already exists, and a new release should create RBAC or other resources that use it
a service account should be created for an RBAC-enabled chart even when RBAC is not being used
In the Jetstack PR discussion, it was proposed that service account values should be split out from RBAC (since they are used by RBAC but exist independently of it) and created or not independently, e.g.:
This adds a bit of complexity, but resolves the issue described above, and additionally allows charts to specify and use multiple service accounts if we add a layer under serviceAccount like so:
I agree with this. I think we should actually alter the Tiller installer to do this. I don't think this introduces any compatibility breakers. And we do this same thing with Brigade (add svc account by default, even if no RBAC), which seems to work for all users.
@omkensey I thought it through again and think the proposal makes sense. I updated the PR accordingly. Please have a look at this commit: cert-manager/cert-manager@52f2c90
Our discussion on cert-manager/cert-manager#229 has disappeared, but after some discussion there, I realized that conflating Service Accounts with RBAC was complicating the use cases. I'm strongly in favor of separating the two as in @unguiculus's and @omkensey's examples above.
Per @unguiculus's example above, I think that's a good default for this (since probably a solid majority of charts that need service accounts only need one), and then we can have a standardized more-complex form (like mine :) ) for cases where one service account just won't do. We don't want to open the floodgates but I think a pattern of "best practice for simple cases" and a more complex "best practice for other cases" would serve us well for this and some other uses.
Guys, I looked thru all discussions which were mentions here, but I didn't find why serviceAccount is on the root level of values and not under RBAC? Even that most of the clusters have RBAC enabled by default. But sometimes people are setting RBAC off cluster for testing purpose. And in those environments, SA creation might fail. So it looks like for rbac.enable=false, chart should not even try to create SA.
Hi @depohmel. Service Account creation won't fail even if you don't have or use RBAC. Service Accounts know nothing of RBAC, and don't care whether you have it or not 😄
This is because Service Accounts are not part of RBAC. They are a separate function that exists independent of RBAC. RBAC is something you optionally add on top, to tell the k8s API to limit access to the API for certain Service Accounts.
You still need Service Accounts, even you don't use RBAC (or you use ABAC or some future RBACv2 instead).
Activity
technosophos commentedon Jan 8, 2018
I agree with this. I think we should actually alter the Tiller installer to do this. I don't think this introduces any compatibility breakers. And we do this same thing with Brigade (add svc account by default, even if no RBAC), which seems to work for all users.
unguiculus commentedon Jan 11, 2018
@omkensey I thought it through again and think the proposal makes sense. I updated the PR accordingly. Please have a look at this commit: cert-manager/cert-manager@52f2c90
unguiculus commentedon Jan 11, 2018
I went for a slightly shorter version:
whereisaaron commentedon Jan 11, 2018
Our discussion on cert-manager/cert-manager#229 has disappeared, but after some discussion there, I realized that conflating Service Accounts with RBAC was complicating the use cases. I'm strongly in favor of separating the two as in @unguiculus's and @omkensey's examples above.
omkensey commentedon Jan 11, 2018
Per @unguiculus's example above, I think that's a good default for this (since probably a solid majority of charts that need service accounts only need one), and then we can have a standardized more-complex form (like mine :) ) for cases where one service account just won't do. We don't want to open the floodgates but I think a pattern of "best practice for simple cases" and a more complex "best practice for other cases" would serve us well for this and some other uses.
unguiculus commentedon Jan 11, 2018
@whereisaaron The discussion is still there. Github just hides it as outdated.
depohmel commentedon Feb 22, 2018
Guys, I looked thru all discussions which were mentions here, but I didn't find why serviceAccount is on the root level of values and not under RBAC? Even that most of the clusters have RBAC enabled by default. But sometimes people are setting RBAC off cluster for testing purpose. And in those environments, SA creation might fail. So it looks like for rbac.enable=false, chart should not even try to create SA.
whereisaaron commentedon Feb 22, 2018
Hi @depohmel. Service Account creation won't fail even if you don't have or use RBAC. Service Accounts know nothing of RBAC, and don't care whether you have it or not 😄
This is because Service Accounts are not part of RBAC. They are a separate function that exists independent of RBAC. RBAC is something you optionally add on top, to tell the k8s API to limit access to the API for certain Service Accounts.
You still need Service Accounts, even you don't use RBAC (or you use ABAC or some future RBACv2 instead).
depohmel commentedon Feb 22, 2018
Oohhhh. Thanks. This was a missing part. Now it does make sense.
unguiculus commentedon Feb 23, 2018
Fixed in #3408.
unguiculus commentedon Feb 23, 2018
/close
whereisaaron commentedon Feb 23, 2018
good stuff!
...aaron boodles off to update all his old charts... 😢