Add support for users with namespace-scoped RBAC permissions #358
amorey
started this conversation in
Technical Spec
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
We would like to make modifications to Kubetail to support users with namespace-scoped RBAC permissions. In order to do this we need to make several changes to the app itself, the development environment and also to the production helm charts. Our overall strategy is to register the Cluster API as a Kubernetes API extension (
APIService) and offload authentication to thekube-apiserverwhich will make it easier to support all of the Kubernetes authentication methods.Motivation
Granting namespace-scoped RBAC permissions to users is a common way to implement multi-tenancy in a Kubernetes cluster. Under this configuration, users have cluster-scope permissions to get/list/watch nodes and namespaces and namespace-scoped permissions to get/list/watch other resources (e.g. pods, deployments). Currently, users with namespace-scoped permissions will encounter permission errors when running Kubetail, making it unusable. After we have implemented the required changes, Kubetail will "just work" for those users.
Goals
auth-mode: tokenon ClusterDesign Details
When you register a
Serviceas anAPIService, it becomes available as a "Kubernetes API extension". Requests to Kubernetes API extensions go through the Kubernetes "proxy" system and are routed internally through thekube-apiserverwhich performs authentication and forwards information about the originating client to the target service in HTTP headers. Kubernetes requires that communication betweenkube-apiserverand the target service be authenticated withmTLSwhich is why we are implementing SSL as part of this project.In the development environment we will need to make these changes:
ConfigMapinto separateConfigMaps's one each for component (dashboard, cluster-api, cluster-agent)In the production environment (helm templates) we will need to make these changes:
In the app and other related systems we will need to make these changes:
APIServicekubetail-cliServiceAccountAPIServiceIn addition, it's possible we may run into problems with the current CSRF protection mechanism in which case we should re-examine our approach to CSRF protection and possibly:
Sec-Fetch-Site: same-originAlso note that adding SSL to the dashboard isn't strictly necessary for this project but it can be done at the same time as the cluster-api with very little added effort.
Alternatives Considered
We briefly looked into implementing full Kubernetes authentication ourselves at the application layer but it didn't look like this would be easy to do and would also introduce a maintenance burden. Also, long-term registering the cluster-api as a Kubernetes api extensions seems like a good way to expose Kubetail to other ecosystem tools.
Open Questions
APIServiceshould work with upgrade requests but we don't have any actual experience with thisBeta Was this translation helpful? Give feedback.
All reactions