You run 30 Kubernetes clusters. How do you keep add-ons and apps consistent across them?
AdvancedScenarioMulti-env and multi-account
Answer
Situation read → Hand-applying anything to 30 clusters guarantees drift. You need one declaration that fans out by cluster attributes.
What I'd do →
- Register every cluster in Argo CD with labels like
env,region,tier. - Use ApplicationSets with the cluster generator to install add-ons everywhere, with values chosen by label:
generators:
- clusters:
selector:
matchLabels:
env: prod
template:
metadata:
name: 'cert-manager-{{name}}'
spec:
source:
repoURL: https://charts.jetstack.io
chart: cert-manager
targetRevision: v1.16.2
helm:
valueFiles: ['values-{{metadata.labels.region}}.yaml']
destination:
server: '{{server}}'
namespace: cert-manager
- Roll out upgrades in waves: dev clusters, then one prod cluster, then the rest (progressive sync or separate ApplicationSets per wave).
- Detect drift: Argo CD sync status across all clusters on one dashboard, with alerts on OutOfSync.
- Clusters themselves come from one Terraform module, so they start identical.
Why → One declaration, many targets, and waves give consistency without big-bang risk.
Interview tip → Mention rolling out add-on upgrades in waves; pushing to all 30 at once is how one bad chart becomes 30 outages.
More on Multi-env and multi-account
Design the AWS account structure for a 50-engineer startup that's growing fast.IntermediateHow do you promote the same build from dev to staging to prod?BeginnerBugs keep passing staging and appearing in production. How do you make staging closer to prod?IntermediateHow do you structure Terraform for dev, staging and prod? Workspaces, directories or Terragrunt?IntermediateDevelopers want a preview environment for every pull request. How would you build it?AdvancedHelm values files or Kustomize overlays for per-environment config?Beginner