billowy-apple-60989
06/09/2025, 12:49 PMGitRepo
that targets /Fleet
in the attached snippet, i'd like to deploy all resources in the common
directory to all clusters in the fleet workspace regardless of cluster labels etc, while the resources in the foo
and bar
should only be deployed to clusters with a fitting label, such as foo-enabled: true
or similar
However i can't figure out how to get that selector to work, no matter what i try everything gets deployed to all clusters. AI-buddy is of no use π
It suggest the following in a fleet.yaml
in the respective directory but that doesn't seem to be correct?
---
clusterSelector:
matchLabels:
foo-enabled: "true"
kustomize:
dir: .
Any ideas is much appreciated.nutritious-diamond-21546
06/23/2025, 6:28 PMnutritious-diamond-21546
06/23/2025, 6:31 PMcommon
and then use kustomize to deploy foo
or bar
depending on cluster selectorsnutritious-diamond-21546
06/23/2025, 6:37 PMnutritious-diamond-21546
06/23/2025, 6:40 PMTarget customization are used to determine how resources should be modified
per target. Targets are evaluated in order and the first one to match a cluster
is used for that cluster.
nutritious-diamond-21546
06/23/2025, 6:41 PMnutritious-diamond-21546
06/23/2025, 6:44 PMfleet.yaml
file as an example, if you applied both the foo-enabled: "true"
and bar-enabled: "true"
labels to the same cluster, the resources in the foo overlays folder would only be applied. This is because the foo
customization is matched first and therefore the bar
customization is not processed.
https://rancher-users.slack.com/files/UHJMNGS2F/F093BHKRJAC/fleet.yamlbillowy-apple-60989
06/24/2025, 11:39 AMtargetCustomizations
could be used to select which cluster gets which bundle. I ended up with a layout like this.
Fleet/
βββ base/
β βββ fleet.yaml
β βββ kustomization.yaml
β βββ *.yaml
β βββ overlays/
β βββ cluster1/
β βββ cluster2/
β βββ ...
βββ foo/
βββ fleet.yaml
βββ *.yaml
And a GitRepo
that target both the base
and the foo
folder, with the fleet.yaml
in foo/
having a overrideTargets
selector.
Thanks for the input! Might be useful if someone else struggles with this π