Module 11 · Operate and grow · 60 min · You are: Platform team
Going to cloud, and splitting the repo
In this module
- You learn: What changes when the same fleet runs on a real cloud (how clusters are created, and how Argo CD logs in to them without long-lived tokens), and how and when to split one repo into infrastructure, platform and product repos.
- You do: Optionally run the fleet on your cloud, sketch the Terraform route, write the repository split as an issue, and find the one long-lived credential the cloud scripts leave behind.
- You end with: A written plan: which folders go to which repository, who owns each, and what replaces the token with workload identity. If you ran the cloud track, an inventory pull request with real cluster addresses.
Everything you built is cloud-agnostic above the cluster line. Two things change in a real cloud: how clusters are created and how Argo CD authenticates to them. And as teams grow, one repo becomes three, because ownership and lifecycles differ.
Open this module in the interactive course to track progress and switch tracks.
Concepts
- fleet-hub is portable
- The module only needs a hub provider configuration and, per spoke, a server, labels and an Argo CD
config. Feed it from your cloud Terraform. - Identity per spoke
- AKS: workload identity and
argocd-k8s-auth azure. EKS: IRSA or Pod Identity andawsAuthConfig. GKE: workload identity andargocd-k8s-auth gcp. No tokens to rotate. - Three repositories
infrastructure-live(Terraform, slow, high blast radius),platform-fleet(ApplicationSets, add-ons, policies, products),<product>-deployment(each team's config). The folders in your repo already have these boundaries.- What moves where
infrastructure/andclusters/to infrastructure-live (it needs the inventory);product-deployments/<x>to each team;product.yamlstays in the platform repo, pointing at the team repo.
Files to know
Open them in your editor or on GitHub; the bullets say what to look at.
infrastructure/README.md(reference, your repo): Running the same fleet on existing or cloud clusters.infrastructure/cloud/aks/up.sh(reference, your repo): What a production-like cloud cluster needs. Skim the flags.- Tier, OIDC issuer, workload identity, network, upgrade channel, autoscaling L66–78
infrastructure/argocd/values-prod.yaml(reference, your repo): Argo CD for a real hub.
Steps
1. Run the cloud track (optional, costs money)
Same repo, real clusters. Every script supports --dry-run.
Create your settings file from the example, and fill it in (the file explains each value):
cd ~/work/fleet-gitops
cp infrastructure/cloud/aks/env.example infrastructure/cloud/aks/env && $EDITOR infrastructure/cloud/aks/env
Read before you run. This prints every command the script would run, and changes nothing:
infrastructure/cloud/aks/up.sh --dry-run
Create the clusters. This costs money while they run:
infrastructure/cloud/aks/up.sh
Propose the real cluster addresses as an inventory change:
git switch -c cloud-inventory && git add clusters && git commit -m "Inventory: aks" && git push -u origin HEAD
When you are done, delete everything so it stops costing money:
infrastructure/cloud/aks/down.sh
2. Sketch the Terraform route for your cloud
Replace the scripts with your cloud's official Kubernetes module for hub and spokes, and call fleet-hub with each spoke's workload-identity config. The README shows the call; the identity configs are in the comments of infrastructure/cloud/lib/argocd.sh.
3. Plan the repository split
Write the split as an issue in your repo: which folders go where, which team owns each repo, which checks each repo needs. Use the table below as the starting point.
infrastructure-live: infrastructure/ and clusters/. Owner: the platform team. Terraform plan and apply run in CI.
platform-fleet: root-app.yaml, applicationsets/, addons/, charts/, products/ and .github/. Owner: the platform team; product teams propose changes to products/.
checkout-deployment: product-deployments/checkout/ with its base/, dev/ and prod/. Owner: team-checkout. The production gate lives here.
4. Find the long-lived credential
The cloud scripts register each spoke with a ServiceAccount token stored on the hub. Find where, and decide what replaces it on your cloud.
Done when:
- You can say where the token is stored and who could read it
- You can name what replaces it on your cloud (workload identity), and what gets deleted afterwards
Search the script for where the token is created and stored. Expect a few matching lines with line numbers; read the code around them.
grep -n "bearerToken\|service-account-token" ~/work/fleet-gitops/infrastructure/cloud/lib/argocd.sh
Quiz
- What has to change in fleet-hub to support EKS?
- Nothing: you pass EKS spokes with an awsAuthConfig-based config
- Everything: the hub has to be rebuilt as an EKS cluster, and every add-on reinstalled
- Argo CD does not support EKS, so the spokes would have to be managed by another tool
- Why split infrastructure into its own repository?
- Git becomes slow when a repository holds many files, so infrastructure moves out for speed
- Different owners, cadence, permissions and blast radius
- Terraform requires its own repository, and refuses to run if the code sits next to manifests
- After the split, where does checkout's product.yaml live?
- In checkout-deployment, since the file now belongs with the manifests it describes
- Nowhere any more; the platform generates it from the inventory on every run
- In platform-fleet, pointing at checkout-deployment
Answers
- Nothing: you pass EKS spokes with an awsAuthConfig-based config The module is cloud-agnostic; the spoke config carries the cloud specifics.
- Different owners, cadence, permissions and blast radius The split follows ownership and lifecycle.
- In platform-fleet, pointing at checkout-deployment The declaration is the contract with the platform, so the platform repo owns it; the config lives with the team.
Field note
Do not split on day one. Split when a second team owns a product, or when the infrastructure cadence starts blocking product changes. The folders make it a mechanical move.