kpt live apply: "Multiple ResourceGroup objects found"
I'm iterating on a few packages locally and trying to use kpt live apply (because kubectl apply doesn't ignore local-config annotations, also pruning is nice)
However, when I nest packages and try to apply a "parent" package, I get:
Error: Multiple ResourceGroup objects found. Please make sure at most one ResourceGroup object exists within the package.
That makes sense, but there doesn't appear a workaround (that I found).
I would expect kpt live apply to either apply a set of ResourceGroups or restrict to the "top" ResourceGroup (and not recurse down)
I wonder how the ResourceGroup sharding feature (https://github.com/GoogleContainerTools/kpt/pull/3430) would impact this and for the ResourceGroup resource adoption use case. @rquitales @karlkfi
My understanding of the kpt deployment feature is that
- A KRM object should only be managed by a single
ResourceGroup. - One package can have at most one
ResourceGroup(that's also the original reason why resource group is placed inside the Kptfile) - Assuming users know what they are doing, they can force a KRM resource to belong to another ResourceGroup.
For nested packages, the workaround or the user-aware approach will be to specifically delete ResourceGroup objects in sub-packages and only keep the one in root pacakge, and force the root ResourceGroup to adopt all resources.
+cc @mortent
@janetkuo The sharding should not be impacted by this feature request to support nested sub-packages (ie. nested ResourceGroup objects, assuming that we don't want to use the workaround provided by @yuwenma where the parent ResourceGroup owns all sub-packages' resources).
Sharding of resources only occurs on the live cluster due to etcd limitations. The local ResourceGroup object is not split up.