-
Notifications
You must be signed in to change notification settings - Fork 172
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
feat: manage mappings for pre-defined service accounts #1548
Conversation
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
✅ Deploy Preview for docs-kargo-akuity-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1548 +/- ##
==========================================
+ Coverage 30.30% 30.46% +0.15%
==========================================
Files 190 189 -1
Lines 19874 19908 +34
==========================================
+ Hits 6023 6064 +41
+ Misses 13593 13577 -16
- Partials 258 267 +9 ☔ View full report in Codecov by Sentry. |
I see that these will hardwire to the install namespace (.Release.Namespace). There was an idea (perhaps even proposed by you) where these ServiceAccounts did not necessarily have to reside in the kargo installation namespace. The idea being WDYT about making this configurable? e.g. I'd like the ability to install these in like a |
When I proposed that, my intent was to avoid people messing with the kargo namespace. Or to at least avoid normalizing that. It bothers me less here because it's the chart managing the SA and not a person. That said, the decision to put these SAs in the kargo ns here had more to do with needing to put them in a ns that I know for sure will exist. It's unconventional, but I guess I could make the chart manage a second namespace. I'll tinker with that tomorrow. |
Offline discussion: Because the controller has the logic to dynamically expand permissions for project-specific secrets, I think it makes sense to treat these ServiceAccounts as special, always existing. So I've reversed my thoughts on this and think that |
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Fixes #1368
Adds two new
ServiceAccount
resources (kargo-admin
andkargo-viewer
) if the API server and OIDC are both enabled. (Without both of those enabled, it seems we would not need these.) How these are mapped to claims likesub
,email
, orgroups
can be specified at the time of Kargo installation.Each of these new
ServiceAccount
s are bound to appropriate cluster-level permissions. Forkargo-admin
, those permissions are a near-complete subset of the API server's own permissions. (Access to createSubjectAccessReviews
is not needed.) Forkargo-viewer
, those permissions are an even narrower subset of the API server's permissions.The
kargo-admin
SA does not get any permissions the API server itself does not also get. This includes not having access toSecret
resources cluster-wide. Since #1486, we dynamically expand the API server's permissions to include access toProject
-specificSecret
s asProject
s are created. This PR uses the same mechanism to dynamically expand thekargo-admin
ServiceAccount
's permissions as well.cc @gdsoumya