multicloud-operators-subscription icon indicating copy to clipboard operation
multicloud-operators-subscription copied to clipboard

Cannot specify which resources to override in ClusterOverrides.

Open ivan-cai opened this issue 4 years ago • 4 comments
trafficstars

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

ivan-cai avatar Nov 26 '21 02:11 ivan-cai

/assign @mikeshng

ivan-cai avatar Nov 26 '21 12:11 ivan-cai

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

mikeshng avatar Dec 01 '21 14:12 mikeshng

thx @mikeshng, but I also want to know the reason for cannot specifying resources' kind and name.

ivan-cai avatar Dec 06 '21 07:12 ivan-cai

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.

mikeshng avatar Dec 06 '21 16:12 mikeshng