Cross-namespace support in PackageVariant #555
Replies: 5 comments 4 replies
|
In my opinion, we should raise the question as to whether any of the Porch resources need to be namespaced objects. IMO, they are management objects that do not clearly belong in namespaces and could happily live outside of them. The only advantage provided by namespaces is some kind of RBAC isolation (multi tenant management clusters? do such things even exist?), but I wonder if any of these edge cases that can't be solved equally well with ClusterRoles. (In my TKO experiment the entire KRM interface is non-namespaced.) |
Perhaps, but how do you make sure the PV author has permission to add that SA? Gateway API solves this with ReferenceGrant objects, which effectively enable the admin to define import/export rules for resources between namespaces. See https://gateway-api.sigs.k8s.io/api-types/referencegrant/. There has been some discussion of making this part of the standard K8s API, but I don't know the status of that. |
|
I believe a SA approach is the way forward as I also brings in identity capabilities which is a big missing items today. |
Good question :) I am not a security expert, so I naively thought that if the PV accepts only SAs that are in the same namespace, then it is enough security for our purposes. :) |
|
In the approach I will present on Wednesday I changes the logic of the packageVariant a bit. So the PackageVariant provides context for the pipeline, but all the injection and fancy logic becomes part of the pipeline. So this discussion would move to the pipeline and the access right the pipeline processor has for a particular package. I believe this is a more clean separation of the duties at hand. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hivemind! I want to pick your brains regarding cross-namespace support in
PackageVariant.First, let me describe a Nephio-like use case: I have a so-called
DeploymentStrategyCRD, whose controller will create multiplePackageVariantsthat clone blueprints to "for-deployment" repositories, and in the process it injects theWorkloadClusterobject that describes the configuration and state of the target cluster into the downstream package. Due to lack of cross-namespace support inPackageVariantI have to put everything into the same namespace: theDeploymentStrategyobject, thePackageVariants, the upstream and downstreamRepositoryobjects and the whole Nephio "inventory" that contains entries (KRM objects) that I occasionally want to inject into the deployment packages.IMHO it would be reasonable to separate the
RepositoriesandWorkloadClusterobjects (and more) into a commonnephio-inventorynamespace that is common to multiple deployments/tenants. At the same time I want to keep theDeploymentStrategyand thePackageVariantsit owns in a tenant/deployment-specific namespace.What do you think?
@johnbelamaric wrote this in a previous thread:
I agree that this is a valid argument. I would still argue that it would worth the effort to enable cross-namespace support for at least the objects that PVs inject into downstream packages. One solution that comes to mind is to extend the PV spec with a serviceaccount field, and only allow access to resources from other namespaces that is allowed for that particular serviceaccount. I understand that this adds quite a bit of complexity to the PV controller implementation.
This issue is closely related to #507, but I extended the topic to the injected in-cluster KRM resources, as well.
All reactions