Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot specify which resources to override in ClusterOverrides. #45

Open
ivan-cai opened this issue Nov 26, 2021 · 4 comments
Open

Cannot specify which resources to override in ClusterOverrides. #45

ivan-cai opened this issue Nov 26, 2021 · 4 comments
Assignees

Comments

@ivan-cai
Copy link
Contributor

ivan-cai commented Nov 26, 2021

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?

@ivan-cai
Copy link
Contributor Author

/assign @mikeshng

@mikeshng
Copy link
Member

mikeshng commented Dec 1, 2021

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

@ivan-cai
Copy link
Contributor Author

ivan-cai commented Dec 6, 2021

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

@mikeshng
Copy link
Member

mikeshng commented Dec 6, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants