-
Notifications
You must be signed in to change notification settings - Fork 88
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
Slimming down Helm chart k8s api-server privileges (RBAC) #661
Comments
I agree that supporting multiple namespaces is not worth the additional complexity. Do we actually need to support dynamic updates to If we do want to support dynamic updates - the proposal above LGTM. |
Hmmm your response didn't make me understand clearly what you meant, so I'll try to define some terminology. Also the configuration isn't defined by my response besides an idea about it should be nested under Static / Dynamic terminology clarified
What to go for?I think we should support static credentials and dynamic configuration, but not dynamic credentials. Support for dynamic configuration would be implemented with static credentials providing ClusterRole access, while the chart local namespace and other namespace situations would be supported by static credentials with Role resources where possible - created in one specific namespace. The Helm chart configuration we add should be located under
RBAC resources currently providedPractical changes
I'm not fully confident on where things are created etc, but I think this is doable. Here is relevant documentation. I think its fair to ask that the using a dedicated namespace also manually creates it ahead of time. I suspect #626 may be almost doing exactly this, but I'm not sure. |
Thanks - I didn't understand this from the previous discussion. The only way to support dynamic configuration is with non-namespaced RBAC, since the DaskClusters may spawn in arbitrary namespaces. I think that Practically, this means we will have three variations on RBAC configurations bound to the ServiceAccount in the chart-local namespace:
An addition to the "Practical Changes" section above: in addition to modifying the chart, there are also changes in code. For example: kubernetes/backend.py#L374 would need to call |
@consideRatio: I think we all got busy with higher priority stuff for a while, but it's come back on my radar as there's another site that's interested in namespaced dask-gateway (@clundst). Are you OK with my comment above and should we proceed on a generating a PR? I'm also a little fuzzy on the 2nd use case above: where |
@consideRatio: been a few months -- please let me know if you're OK with the approach before I sync up a PR against the current main. |
Looking through this again, okay this sounds reasonable @holzman. Here are some thoughts summarized:
We've deliberated on using I propose the following config:
An example config could then be I'd like the PR implementing this to test specifying some other namespace in Overall, I think the PR could be quite small and simple: add the new config, transition from ClusterRole(Binding) to Role(Binding) if If this is done, I think the test automation we have already will clarify if it works or not. |
We were discussing this in our team meeting today. Just wanted to let you know that we haven't abandoned it, and I'll find some time in the next few weeks to work on this. |
I've come back around to fighting this again. This prevents our multi-tenent flux from doing a dask-gateway helm release as the serviceAccount for the namespace does not have Cluster wide permissions. |
Checking to see if there's been any further discussions / thoughts on continuing forward with this ? |
Currently the Helm chart provides more cluster wide permissions against the k8s api-server than may be needed, depending on configuration of dask-gateway.
The following PRs are opened related to this, but I felt that reviewing them was focusing on technical details before I had considered the configuration API that would make to support. Due to that, I've opened this issue to brainstorm and try to establish what I'm looking for.
Situations
The helm chart is installed in one location which provides a dask-gateway-controller, dask-gateway-server (api pod), dask-gateway-proxy (traefik pod). They should be provided with the relevant permissions to create and interact with the k8s resources created.
Thanks to configuration, on demand created Dask clusters can be created in different namespaces. Due to that, we provide permissions to work with resources in all namespaces.
1. Local namespace: clusters created only in helm chart local namespace
Reduced permissions required.
With local I mean where the daks-gateway Helm chart was installed.
2. Other namespace: clusters created only in another pre-configured namespace
Reduced permissions required, but not just like as if everything was put in a local namespace.
3. Any namespace: clusters created in any namespace
Full cluster wide permissions required. My assumption is that it is not possible to provide RBAC resources defining permissions to namespaces matching a certain naming pattern or having a certain label, if that is incorrect we can do something smarter here as well.
Current configuration options
gateway.backend,namespace
.gateway.backend.namespace
is mapped to the Python configurationKubeClusterConfig.namespace
within the dask-gateway server (api pod).Future configuration options?
What we currently have seems sufficient to me.
gateway.backend.namespace
is used (as compared to settingc.KubeConfigCluster.namespace = "something"
in a custom Python config file provided to dask-gateway-server).Implementation ideas
I think when someone configures the
gateway.backend.namespace
, we should reduce the permissions to that.I think when someone doesn't configure the
gateway.backend.namespace
, we should reduce the permissions to the local namespace.A secure default is far better than an unsecure default. At the same time, a user should be able to request cluster wide permissions so that c.KubeClusterConfig.namespace` can be dynamically updated and still work.
So, we would need another Helm char configuration option to provide cluster wide permissions. I note that
rbac.scope
is used by the prometheus helm chart.With all this considered, I think we should let
gateway.backend.namespace
just be something we pass through to the Python configurationc.KubeConfigCluster.namespace
, and letrbac.scope
decide if we provide cluster wide or namespace scoped RBAC permissions. That way, we have sufficient flexibility I think.Towards resolving this
rbac.scope
like configuration syntax. It should support cluster wide mode and single namespace mode, support for multiple namespaces seems like more complexity than merited in my mind.The text was updated successfully, but these errors were encountered: