-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Kubernetes extension - Configurable role policies #21595
Conversation
Signed-off-by: Florian Heubeck <[email protected]>
10114af
to
da7eb2f
Compare
@iocanel can you take a look at this one? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave a quick glimpse and I have some comments for discussion.
Note: These are topics for discussion and not change requests.
-
The pull request assumes that only one role may be added and bound to the application. While this is not necessarily a bad idea it might be a bit too restrictive.
-
Should we cover cases were we bind existing roles? This doesn't seem possible at the moment.
-
The configuration target introduce in this PR, is pretty much the
PolicyRule
so properties likecluster-wide
appear on logical level below their actual targetRole
. What happens when different policies have conflictingcluster-wide
options? Who wins? -
I am not a huge fan of having to specify a name for policy rules, that are actually unnamed. I am wondering if we should generate
Role
with a single policy each and use that name to specify the role name: Maybe something like:
quarkus.kubernetes.rbac.roles.crd-viewer.api-groups=apiextensions.k8s.io
quarkus.kubernetes.rbac.roles.crd-viewer.resources=crd
quarkus.kubernetes.rbac.roles.crd-viewer.verbs=get
quarkus.kubernetes.rbac.roles.crd-viewer.cluster-wide=true
quarkus.kubernetes.rbac.roles.crd-viewer.binding=my-app-crd-viewer
In this example quarkus.kubernetes.rbac.roles.crd-viewer.binding=my-app-crd-viewer
could be possibly used on its own when it comes to provided roles (?)
@@ -0,0 +1,40 @@ | |||
import io.dekorate.utils.Serialization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the biggest part of the kubernetes extension we use standard
tests. We only add invoker
tests to test aspects that are specific to build tool (e.g. passing options to the maven build etc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Let's try and not add invoker tests unless absolutely necessary
Happy to discuss :D
In general, I like your idea, but would put the following under consideration:
Totally makes sense! After we aligned all points, lets define the configuration format and I'll refactor based on that.
Maybe I don't get the point: All
As stated above, it would have to be a map of maps, or is your suggestion, to build Roles with just a single PolicyRule and bind all of them? Could be an option as well, but feels also not very beautiful.
Probably. |
Checked the implementation again and it's clearer to me what you are doing with I need to look at it a bit closer and think about it |
Happy to hear your opinion and ideas. I also thought about if maybe the only senseful option would be, to only specify which ServiceAccount to use. |
I'll have a look later today or tomorrow |
Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a tiny doc comment and a comment about the tests.
Otherwise, LGTM
quarkus.kubernetes.policies.crd.verbs=get,update | ||
---- | ||
|
||
<1> `ext` in this example is only a grouping key for identifying a conjugated `PolicyRule` in the `Role` manifest, it's solely used in the configuration file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<1> `ext` in this example is only a grouping key for identifying a conjugated `PolicyRule` in the `Role` manifest, it's solely used in the configuration file. | |
<1> `ext` in this example is only a grouping key for identifying a conjugated `PolicyRule` in the `Role` manifest, its solely used in the configuration file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact, I wanted to say, that ... the grouping key ... (it) is solely used...
@@ -0,0 +1,40 @@ | |||
import io.dekorate.utils.Serialization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Let's try and not add invoker tests unless absolutely necessary
Let's try to move this forward again. I propose to start with the following changes.
I think that points [1,2,3] is something we both agree on. So, I think that these should be added to PR anyway. The hard part is how is how we define roles ourselves (if we need to).
So we could possibly go with something like this: Option A: Single policy Role
Option B: Multiplicity roles:
I am ok with both approaches, with a small preference to Option B. I suggest moving forward with [1,2,3] first and then work on the hard part. |
@heubeck added some comments on how I think we should proceed ^ |
Hey @iocanel, completely agree with you, 1,2,3 are perfectly fine and definite valuable. It may take some time for me to implement this, as I'm very busy right now - one suggestion: |
Agree |
Will restart that effort at a later point in time. |
Solves #21553