-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Extend --kubernetes-namespace-whitelist to all operations #1471
Comments
I would go for:
But I would do it gradually (at least in different PRs):
However, as far as I recall (I haven't done k8s stuff in a few months, so correct me if I am wrong) there aren't so many global resources, so I wonder if @squaremo Thoughts? |
@2opremio I like that approach -- make it consistent first, then more sensitive to RBAC. (Side request: can we deprecate |
Excuse my ignorance, but why do we need a namespace whitelist/blacklist at all? Isn't RBAC alone sufficient for controlling which namespaces flux should/shouldn't touch? |
@rade I am not an RBAC expert (yet!) but AFAIU, it should be sufficient as long as I was assuming that we wanted to maintain the flag due to:
Regardless, starting with an explicit list of namespaces has been a good way to solve the problem incrementally (worrying about RBAC comes next, my plan is extracting that list from the RBAC rules). |
Why would it have to be able to list them? Surely simply trying to do something, and correctly interpreting any resulting error due to RBAC, would suffice.
ERRTOOMANYKNOBS indeed. Furthermore, the extra knob has to keep that consistent with the RBAC knob. |
I am not sure that suffices. I don't yet know all the architecture details of
And there's probably other cases I am missing. Now, RBAC has resource-granularity, so, a list of namespaces won't be enough but the sample issues apply. |
There are two things:
Or
This creates a problem when you have a flux to manage your cluster and you want another locked-down version to manage your application. Having the ability to whitelist/blacklist namespaces is very useful because bny doing so, flux is saying |
Too much newness in this proposal, it would either be a breaking change or a new feature, neither of which can be accepted as Flux v1 is in maintenance. Closing. Thanks |
At present, the experimental flag
--kubernetes-namespace-whitelist
controls which workloads appear in ListControllers and ListImages. This is useful for restricting the view of the cluster.The usual expectation is that fluxd's operations can be entirely limited to the namespaces given; i.e., that the restriction appliees also to the resources that will be synced, workloads that are scanned for images, workloads that can be updated, and so on.
One tricky thing here is what to do with syncing resources that are not namespaced. I can think of a couple of designs:
Apply namespaces if they're on the whitelist; otherwise, ignore cluster-level resources unless fluxd has not been given a whitelist. A problem with this is: how do you then sync cluster-level things? A fluxd without a whitelist will try to sync everything ..
Apply namespaces if they're on the whitelist; otherwise, always attempt to apply cluster-level resources. This has the benefit of being simple, but you may get repeating errors if you have restricted fluxd with RBAC.
Have a flag determining whether fluxd will try to sync cluster-level resources, and succeed or fail based on RBAC. This at least means you can tell one fluxd to do the cluster-level things (and give it permission).
More hand-wavingly -- specify the whitelist in a way that is a bit closer to RBAC, so you can carve out exactly what you want to be able to operate on.
The text was updated successfully, but these errors were encountered: