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

Feature Request: variables in targetCustomizations? #1395

Open
strowi opened this issue Mar 10, 2023 · 5 comments
Open

Feature Request: variables in targetCustomizations? #1395

strowi opened this issue Mar 10, 2023 · 5 comments

Comments

@strowi
Copy link

strowi commented Mar 10, 2023

Is your feature request related to a problem?

Hi,

currently we are planning to deploy a lot of IoT devices. Only difference is a configMap. While using fleet + kustomize i will have to do sth. like this:

defaultNamespace: edge

kustomize:
  # default no deployment
  dir: kustomize/default

targetCustomizations:
  - name: app-0531
    clusterName: app-0531
    kustomize:
      dir: kustomize/app-0531
...

Obviously i don't want to repeat that for xxx customizations for each cluster.

Solution you'd like

Baiscally i want each cluster to have it's own kustomize-dir without having to specify it manually.
Similar to the gobal.fleet variables, but it seems those are not available here?

Alternatives you've considered

No response

Anything else?

No response

@kkaempf
Copy link
Collaborator

kkaempf commented Mar 10, 2023

We merged #671 and #1158 recently 😉

@strowi
Copy link
Author

strowi commented Mar 10, 2023

If i understand correctly those 2 relate to the helm values?
So I'd have to rewrite my kustomize to helm and add some templating in there to mount different configMaps?

I was hoping for sth like the following, but i can see that that might create more problems.

targetCustomizations:
  - name: ${ global.fleet.clusterLabels.management.cattle.io/cluster-name }
    clusterName: ${ global.fleet.clusterLabels.management.cattle.io/cluster-name }
    kustomize:
      dir: kustomize/${ global.fleet.clusterLabels.management.cattle.io/cluster-name }

Will think about that over the weekend, thank you ;)

@WMP
Copy link

WMP commented Feb 6, 2024

I am also interested in such a solution

@jhoblitt
Copy link
Contributor

jhoblitt commented May 20, 2024

I have fleet.yaml files approaching targetCustomizations for 20 clusters. The files repeat this pattern over and over again.

  - name: ayekan
    clusterName: ayekan
    yaml:
      overlays:
        - ayekan
  - name: kueyen
    clusterName: kueyen
    yaml:
      overlays:
        - kueyen
...

And it turns out that this has become error prone in that devs are adding the overlay dir but forget to add the cluster name into the fleet.yaml.

@strowi
Copy link
Author

strowi commented Jun 1, 2024

I just found this https://fleet.rancher.io/ref-fleet-yaml#templating on the "Next" docs.
Am reading this wrong or does it sound like it would template the WHOLE fleet.yaml (not just the helm.values etc..)?

That would be really neat and we could hopefully use sth. like this instead of currently 354 lines containing only targetCustomizations ;) :

targetCustomizations:
  - name: ${ get .ClusterLabels global.fleet.clusterLabels.management.cattle.io/cluster-name }
    clusterName: ${ get .ClusterLabels global.fleet.clusterLabels.management.cattle.io/cluster-name }
    kustomize:
      dir: kustomize/${ get .ClusterLabels global.fleet.clusterLabels.management.cattle.io/cluster-name }

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

No branches or pull requests

5 participants