Last Run Against TKG 1.1
This is a sample showing the power of Cluster API and Tanzu Kubernetes Grid in a GitOps work model.
You start with the Management Cluster, do a typical install of TKG following the directions here
- Fork this repository, rename references in the code pointing to https://github.com/voor/cluster-api-gitops to your fork. Push those changes.
- Go into
management-cluster/deploy/workload-secrets
and change the example file accordingly.- This assumes you are using CloudFlare to manage your domain specified in the domain secret, if you are not you'll need to change the
letsencrypt
andexternal-dns
programs in the workload folder accordingly. - You have a GitHub OAuth2.0 application setup, or you'll need to change
dex-config.yaml
to point elsewhere.
- This assumes you are using CloudFlare to manage your domain specified in the domain secret, if you are not you'll need to change the
- Populate the management cluster, go into the
management-cluster
folder and run:./populate-management.sh
- Create your first workload cluster:
./create-cluster.sh hello-world -c 1 -p dev -w 1
- Commit the
${CLUSTER_NAME}
.yaml file that was added intoworkload/manifests
into git and push it. - Wait a few minutes.
- Visit the URL
https://kuard.apps.${DOMAIN}
where${DOMAIN}
is the url you specified in theworkload-secrets
yaml.
Go into the yaml for the workload cluster and change the number of MachineDeployment
replicas.
Go into the yaml for the workload cluster and change the number of KubeadmControlPlane
replicas.
TODO
Everything for workload clusters is found in the workload
folder in this repository, this sample takes a few commonly used applications that are both Helm, Jsonnet, and pure manifest based.
Helm applications are committed directly as manifests to remove any surprises and make this more air-gapped friendly. kapp-controller supports helm charts directly, so see there for more documentation on how to modify this to pull directly from a helm repository.
Everything is run through ytt
, so even if you are checking out manifests directly from a release (and if you are, you can always just fetch over URL), you can apply overlays or other modifications without committing them directly to the release files.