Closed Imtiaz246 closed 3 days ago
@Imtiaz246 thanks for reporting this
we can't configure the namespace dynamically as per the https://github.com/open-cluster-management-io/ocm/issues/298 describes.
PR https://github.com/open-cluster-management-io/addon-framework/pull/218 is trying to fix this.
additionally, we want to leverage helm chart built-in values such as {{ Release.Namespace }} and {{ Release.Name }}
there are 3 helm built-in values are supported, fortunately, {{ Release.Namespace }}
and {{ Release.Name }}
are included.
@Imtiaz246 I submitted a PR to support configuring the namespace for the helm addons, if you want you can try it with the latest addon-framework, example here
Great @zhujian7. Thank you for your quick response. Things are working as expected now.
@zhujian7 , I think there is still one thing left to fix
addon.GetAgentAddonOptions().InstallStrategy.InstallNamespace
is configured correctly
There is also one more issue here. The ManagedClusterAddon
crd defaults installNamespace
to open-cluster-management-agent-addon
.
This causes problem because it does not take the correct installNamespace from the ClusterManagementAddon
.
https://github.com/open-cluster-management-io/ocm/blob/8a4c834ebf0f3c71ab9209572fb0b11cc942f5d5/pkg/addon/controllers/addonmanagement/addon_install_reconciler.go#L72
/assign @zhujian7
@tamalsaha we are going to deprecate the managedclusteraddon.spec.instllNamespace, if you want to make the ns configurable, I suggest you use the AgentInstallNamespace func to fully control the namespace value, for example, you can implement this func to read the value from the API addondeploymentconfig.spec.agentInstallNamespace, then any value changed in the field addondeploymentconfig.spec.agentInstallNamespace
will be reflected on where the addon agent is installed.
/close
@qiujian16: Closing this issue.
Problem Statement:
helm-agent-addon
using the installStrategy feature defined in theClusterManagementAddon
API. Currently we can't configure the namespace dynamically as per the ocm:issues:298 describes. In our use case, we need the ability to configure the namespace for the helm-agent-addon dynamically.{{ Release.Namespace }}
and{{ Release.Name }}
to set the values of the helm-agent-addon.Proposed Solution:
helm-agent-addon
namespace. This would enable users to specify the namespace at build time through some configuration parameters.Use Case Example:
helm-agent-addon
namespace using the helm chart built-in value{{ Release.Namespace }}
which would ensure consistency with the parent Helm release.