You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We believe implementing selector support (preferably with a mechanism similar to ResourceSourceSelector) in Sveltos would offer the following benefits:
Reference resources with dynamic names
While ObjectReference requires fixed names, using selectors enables flexible referencing of dynamically generated resources.
Generate resources based on multiple resource contents
This enables flexible operations that consider the states and attributes of multiple resources when generating final resources. While aggregatedSelection is supported in EventSource, we would like to see similar functionality in EventTrigger and ClusterProfile as well.
Enable recursive processing
This enables recursive processing, such as referencing resources generated within the same ClusterProfile or EventTrigger, which previously required combining multiple ClusterProfiles.
For these reasons, we would like to request your consideration for implementing selector support (functionality equivalent to ResourceSourceSelector) in Sveltos. We believe this would expand the range of use cases by allowing users to reference and utilize resources more flexibly.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered:
Hi @kahirokunn the approach is Sveltos is different. If you need to collect N resources via label selector for instance, you would create an EventReport with:
EventSource that selects all resources you need (via label selector)
(for instance) create a ConfigMap with one entry per resource and deploy a ClusterProfile that fetches via TemplateResourceRefs this configMap
After point 2, the ClusterProfile has access to all its need. But the ClusterProfile remain simple (just one resource fetched and an identifier associated to it making it easy to use it inside the template).
If you are OK we can close this. Or better if you have any such concrete example, we can write a tutorial on how to use EventTrigger + ClusterProfile to solve this use case.
step1: Create an EventSource and an empty EventTrigger, then generate an EventReport.
step2: Directly reference the EventReport from the ClusterProfile's templateResourceRefs, base64 decode the spec.resources and loop through them in a for loop.
Is that correct?
I feel that if there was documentation here, Sveltos would be more helpful.
Thank you. 🙏
Currently, templateResourceRefs in both addon-controller and event-manager only support ObjectReference, as implemented in the following example:
https://github.com/projectsveltos/addon-controller/blob/d6fbb74b53d512cd2ebeeb1dbc914f379b689ebe/api/v1beta1/spec.go#L518-L532
Meanwhile, Crossplane's function-extra-resources supports two methods of resource referencing:
ObjectReference
Similar to the existing implementation, this method references resources by specifying
type: Reference
ResourceSourceSelector
This method enables selector-based resource selection that cannot be handled by ObjectReference
(For details, please refer to https://github.com/crossplane-contrib/function-extra-resources/blob/7a4ef280ea9aea3e37b3f0d324188537e4a6b4fe/input/v1beta1/resource_select.go#L69-L94)
Here's an example YAML using ResourceSourceSelector:
As a practical example, extraResources can be pulled within a Composition and used for template processing:
We believe implementing selector support (preferably with a mechanism similar to ResourceSourceSelector) in Sveltos would offer the following benefits:
Reference resources with dynamic names
While ObjectReference requires fixed names, using selectors enables flexible referencing of dynamically generated resources.
Generate resources based on multiple resource contents
This enables flexible operations that consider the states and attributes of multiple resources when generating final resources. While aggregatedSelection is supported in EventSource, we would like to see similar functionality in EventTrigger and ClusterProfile as well.
Enable recursive processing
This enables recursive processing, such as referencing resources generated within the same ClusterProfile or EventTrigger, which previously required combining multiple ClusterProfiles.
For these reasons, we would like to request your consideration for implementing selector support (functionality equivalent to ResourceSourceSelector) in Sveltos. We believe this would expand the range of use cases by allowing users to reference and utilize resources more flexibly.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered: