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.) |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I believe a SA approach is the way forward as I also brings in identity capabilities which is a big missing items today. |
Beta Was this translation helpful? Give feedback.
-
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. :) |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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
DeploymentStrategy
CRD, whose controller will create multiplePackageVariants
that clone blueprints to "for-deployment" repositories, and in the process it injects theWorkloadCluster
object that describes the configuration and state of the target cluster into the downstream package. Due to lack of cross-namespace support inPackageVariant
I have to put everything into the same namespace: theDeploymentStrategy
object, thePackageVariants
, the upstream and downstreamRepository
objects 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
Repositories
andWorkloadCluster
objects (and more) into a commonnephio-inventory
namespace that is common to multiple deployments/tenants. At the same time I want to keep theDeploymentStrategy
and thePackageVariants
it 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.
Beta Was this translation helpful? Give feedback.
All reactions