multicloud-operators-subscription
multicloud-operators-subscription copied to clipboard
Cannot specify which resources to override in ClusterOverrides.
I wonder why cannot specify which resources(apiversion,kind,name...) to override in ClusterOverrides(subscription.spec.overrides). Is it because of the overrides only apply to the application dimension, not resource dimension?
https://github.com/open-cluster-management-io/multicloud-operators-subscription/blob/4e2c4d011c03ac8a57b82eea2ff5b6d264b28b01/pkg/apis/apps/v1/subscription_types.go#L167
/assign @mikeshng
Hi @ivan-cai ,
I think what you can use PackageOverrides + Kustomize see https://github.com/open-cluster-management-io/multicloud-operators-subscription/blob/main/docs/gitrepo_subscription.md#kustomize for Git app subscriptions
For Helm subscriptions see https://github.com/open-cluster-management-io/multicloud-operators-subscription/blob/main/examples/helmrepo-channel/02-subscription.yaml#L10-L17 as an example to override chart values which can edit the resources.
As for ClusterOverrides, as the name implies it was meant to modify some desired clusters. For example,
overrides:
- clusterName: cluster2 # only do the follow Helm subscription package override for managed cluster name cluster2
clusterOverrides:
- path: spec.packageOverrides
value:
- packageName: apache
packageOverrides:
- path: spec
value:
replicaCount: 2
thx @mikeshng, but I also want to know the reason for cannot specifying resources' kind and name.
I think it comes down to audit/traceability. One of the benefits of GitOps is that git commits can be use as a history of changes that were applied. If the subscription spec has resource override then the changes in git commits might not actually reflect on what actually were applied.