-
Notifications
You must be signed in to change notification settings - Fork 61
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
Limit cluster access #219
Limit cluster access #219
Conversation
We do need it, but the rule for the controller needs to be slightly different since it does not create a node-local resourceslice but rather a resourceslice associated with a group of nodes. |
Also, the DCO is failing because you didn't sign your commits. |
@bart0sh @pohly what is the best way to add admission policy for a pool of nodes and not just a single node. The upstream work exemplifies node level validation https://github.com/kubernetes/kubernetes/blob/4aeaf1e99e82da8334c0d6dddd848a194cd44b4f/test/e2e/dra/test-driver/deploy/example/plugin-permissions.yaml#L41 Why is this even needed, help me understand. Our resource slice for the imex controller has these fields
And this is what i modified it to. I dint find any direct way to get the node label in validatingadmissionpolicyspec. You can only request node name with request.userInfo.extra[?'[authentication.kubernetes.io/node-name']0] and it does not allow complex querying.
Should there be any driver name validation in addition to the pool of nodes. Thank you for your time. |
deployments/helm/k8s-dra-driver/templates/validatingadmissionpolicy.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Swati Gupta <[email protected]>
Signed-off-by: Swati Gupta <[email protected]>
Signed-off-by: Swati Gupta <[email protected]>
89abbec
to
8b7a9d1
Compare
Looks good to me at first glance. I'll leave the final approval to @cdesiniotis though, since he reviewed things more thoroghly. |
I am not sure if validatingadmissionpolicy is required right now. And we may add more rules like only allow updates when driver is gpu.nvidia.com, something like
object.spec.driver == 'gpu.nvidia.com'
I did a quick test with the original implementation done here https://github.com/kubernetes/kubernetes/blob/4aeaf1e99e82da8334c0d6dddd848a194cd44b4f/test/e2e/dra/test-driver/deploy/example/plugin-permissions.yaml#L38