How do you target a subset of clusters (e.g., only production)?
Short answer
Label registered clusters (e.g., env=prod, region=eu) and use a cluster generator selector with matchLabels/matchExpressions to include only matching clusters.
Advertisement
AModel answer
Label registered clusters (e.g., env=prod, region=eu) and use a cluster generator selector with matchLabels/matchExpressions to include only matching clusters. This lets one ApplicationSet deploy to just the intended fleet subset and automatically include new clusters that match the labels.
generators:
- clusters:
selector:
matchLabels: { env: prod }Real-world example
A monitoring stack ApplicationSet deploys only to clusters labeled env=prod via the selector.
Likely follow-ups
- Where are cluster labels set? | How does matchExpressions differ from matchLabels?
Related topics