kubernetes-sigs / kubernetes-sigs/cluster-api
Consider limited kubeconfig for internal components and consumers
- Dominant language
- Go
- Stars
- 4.3k
- Forks
- 1.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 113
Description
**User Story**
As a developer/user/operator I would like to CAPI core internal components to be granted only with the perms they need.
**Detailed Description**
Today CAPI generates [a full admin config](https://github.com/kubernetes-sigs/cluster-api/tree/main/util/kubeconfig) that is then consumed by the Machine Controller and by any component [claiming a cluster accessor through the remote cache tacker](https://github.com/kubernetes-sigs/cluster-api/tree/main/controllers/remote), i.e `r.Tracker.GetClient(ctx, util.ObjectKey(cluster))`.
The Machine controller shouldn't need full admin client to operate successfully.
There might be other components needing narrowed set of permissions:
- Autoscaling.
- Azure AD for cluster authentication https://capz.sigs.k8s.io/topics/aad-integration.html (if you have the admin kubeconfig it kind of defeats the purpose).
This is to discuss alternatives for:
1 - Create limited kubeconfigs for consumption of our internal core components.
2 - Consider providing a way to express desired for capi outputting t-shirt size / limited kubeconfigs.
**Anything else you would like to add:**
[Miscellaneous information that will assist in solving the issue.]
/kind feature
Contributor guide
Research direction
Start by reading util/kubeconfig and controllers/remote, especially the r.Tracker.GetClient(ctx, util.ObjectKey(cluster)) path described in the issue. Compare how the Machine Controller consumes the generated admin config and consider the listed alternatives for limited configs or requested permission sizes. Done means the proposal has a decided approach for internal components and consumers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- authorization, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100