When reviewing our deployment of Flux and checking the docs, I noticed what I think may be a gap.
The source controller doesn't seem to have --default-service-account and while the flux multi-tenancy page does not include this controller, I think it should have this flag and be included in that page.
Steps to reproduce
Install Flux
Configure Flux for multi-tenancy
Read the docs and the example code -- there is no spec.serviceAccountName field on the source custom resources; and no support for --default-service-account in the source controller, and the controller is not mentioned on the multi-tenancy page.
Expected behavior
Source controller can impersonate a service account in a namespace and reconcile the source custom resources with that service account instead of the pod service account which has cluster admin.
Screenshots and recordings
No response
OS / Distro
N/A
Flux version
2.3.0
Flux check
N/A
Git provider
Bitbucket
Container Registry provider
Cloudsmith
Additional context
While source controller doesn't reconcile kubernetes resources, it does reconcile GitRepository and HelmRepository resources status fields across namespaces unless --watch-all-namespaces=false or --watch-label-selector is passed to reduce what it watches.
Because of this, I think source controller should be able to be given the ability to impersonate a user in another namespace and similar to how we can configure kustomize and helm controllers, we should be able to configure a default service account for the source controller and specify the service account for reconciliation of the GitRepository, HelmRepository, HelmChart, and Bucket resources in each namespace.
Specifically, I'm trying to reduce the effective privileges of flux so that it leverages cluster admin only when absolutely necessary, and this controller (as well as notification controller, but that's another beast entirely) seems to continue to rely on the pod service account privileges while helm controller and kustomize controller can reconcile their respective (Kustomization, HelmRelease) resources with the privileges that those service accounts have.
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Describe the bug
When reviewing our deployment of Flux and checking the docs, I noticed what I think may be a gap.
The source controller doesn't seem to have
--default-service-account
and while the flux multi-tenancy page does not include this controller, I think it should have this flag and be included in that page.Steps to reproduce
spec.serviceAccountName
field on the source custom resources; and no support for--default-service-account
in the source controller, and the controller is not mentioned on the multi-tenancy page.Expected behavior
Source controller can impersonate a service account in a namespace and reconcile the source custom resources with that service account instead of the pod service account which has cluster admin.
Screenshots and recordings
No response
OS / Distro
N/A
Flux version
2.3.0
Flux check
N/A
Git provider
Bitbucket
Container Registry provider
Cloudsmith
Additional context
While source controller doesn't reconcile kubernetes resources, it does reconcile GitRepository and HelmRepository resources
status
fields across namespaces unless--watch-all-namespaces=false
or--watch-label-selector
is passed to reduce what it watches.Because of this, I think source controller should be able to be given the ability to impersonate a user in another namespace and similar to how we can configure kustomize and helm controllers, we should be able to configure a default service account for the source controller and specify the service account for reconciliation of the GitRepository, HelmRepository, HelmChart, and Bucket resources in each namespace.
Specifically, I'm trying to reduce the effective privileges of flux so that it leverages cluster admin only when absolutely necessary, and this controller (as well as notification controller, but that's another beast entirely) seems to continue to rely on the pod service account privileges while helm controller and kustomize controller can reconcile their respective (Kustomization, HelmRelease) resources with the privileges that those service accounts have.
Code of Conduct