open-cluster-management-io / addon-framework

addon apis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for multiple resources of the same GVR in the ManagedClusterAddOn resource

JoaoBraveCoding opened this issue · comments

Request/Feature

Add support for multiple resources of the same GVR in .spec.configs section of the ManagedClusterAddOn resource. The goal is that AddOns can then iterate over ManagedClusterAddOn.Status.ConfigReferences and have access to multiple resources with the same GVR.

Use Case

Our AddOn (rhobs/multicluster-observability-addon) can configure ClusterLogForwarding on a fleet of clusters to forward logs to a Loki central instance. For this, we need to provide the addon with a configmap containing the authentication method that should be used, a configmap with the Loki URL that should be used for that specific spoke cluster and finally if we are using mTLS a configmap with the CA Bundle of the Loki instance.

In total that's 3 configmaps that we have to add to the .spec.configs section of the resource ManagedClusterAddOn when we create it in the namespace of a spoke cluster.

/assign @qiujian16

@zhujian7 @haoqing0110 we have to discuss about it on whether it is feasible. The major concern, is if the user select specify multiple configurations with the same gvk, do we merge them or use the one with the highest order or it is purely addon's decision.

The major concern, is if the user select specify multiple configurations with the same gvk, do we merge them or use the one with the highest order or it is purely addon's decision.

Maybe it's because I'm not familiar with all the inner workings of the addon-framework but what about taking all the resources with the same GVK and hashing them all to compute the specHash? The "only" concerning part I see is the "default" behaviour that you can set on ClusterManagedAddon... 🤔 A way out I see is if we add to ConfigMeta a bool value (e.g singleton) which would enable the default behaviour. So when singleton is true the addon framework will merge the default config with the ManagedClusterAddon config, otherwise it will require users to provide that config

this has been done
/close

@qiujian16: Closing this issue.

In response to this:

this has been done
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.