https://rancher.com/ logo
#fleet
Title
# fleet
c

calm-twilight-27465

03/20/2023, 11:36 PM
I have a bundle that needs to be customized on multiple axes (region, environment), I think I'm missing something in how targetCustomization or how clusterSelector work to cover such a use case.
I'd expect to be able to do something like:
Copy code
targetCustomizations:
  - name: region-a
    clusterSelector:
      matchLabels:
        region: a
      helm:
        values:
          regionSpecificKey: region-a-value
  - name: region-b
    clusterSelector:
      matchLabels:
        region: b
      helm:
        values:
          regionSpecificKey: region-b-value
  - name: dev
    clusterSelector:
      matchLabels:
        environment: dev
      helm:
        values:
          environmentSpecificKey: dev-value
  - name: prod
    clusterSelector:
      matchLabels:
        environment: prod
      helm:
        values:
          environmentSpecificKey: prod-value
Or at least be able to do something like:
Copy code
targetCustomizations:
  - name: region-a-dev
    clusterSelector:
      matchLabels:
        region: a
        environment: dev
      helm:
        values:
          regionSpecificKey: region-a-value
          environmentSpecificKey: dev-value
  - name: region-b-dev
    clusterSelector:
      matchLabels:
        region: b
        environment: dev
      helm:
        values:
          regionSpecificKey: region-b-value
          environmentSpecificKey: dev-value
  - name: region-a-prod
    clusterSelector:
      matchLabels:
        region: a
        environment: prod
      helm:
        values:
          regionSpecificKey: region-a-value
          environmentSpecificKey: prod-value
  - name: region-b-prod
    clusterSelector:
      matchLabels:
        region: b
        environment: prod
      helm:
        values:
          regionSpecificKey: region-b-value
          environmentSpecificKey: prod-value
But neither of these seem to be an option because it's first match wins (no composition), and OR (not AND) when using multiple labels in a match.
d

dry-policeman-72946

04/11/2023, 7:50 AM
I ended up assigning a unique custom label to every single cluster and select on it. That does not scale very good, but works for our small scale.
9 Views