- Notifications
You must be signed in to change notification settings - Fork16
stealthybox/multicluster-gitops
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This demo will build you 3 clusters that will allshare their routing information with each other andforward DNS for cross-cluster Services.
The clusters are created usingkind, andcluster0 is used as aFlux management cluster.Access to apply to the remaining clusters is done by mocking ClusterAPI kubeconfigs.
Discovery of other clusters' Nodes is accomplished througha fun bash controller that queries a multicast Serf cluster.This works well on a single docker network or any network that supports multicast.You can also configure Serf to bootstrap from some fixed IP's.
A neat thing about this strategy is that it's declarative!Fork this repo and try it out :)
- your computer
- these tools
- git
- hub (optional)
- flux
- docker
- kind
- kubectl
hub clone stealthybox/multicluster-gitopscd multicluster-gitopshub fork# alternatively fork in the web UI and clone
kind/setup.shkind/load.sh# bootstrap Calico for Fluxkubectl apply --context kind-cluster0 -k ./config/cluster0/kube-systemGITHUB_USER=stealthybox# set your own user here to match your forkexport GITHUB_TOKEN="<personal access token with repo and SSH key rights>"flux bootstrap github \ --owner"${GITHUB_USER}" \ --personal \ --repository"multicluster-gitops" \ --path"./config/cluster0"
alternatively, if you want to not use github & flux, apply thekube-system anddefault kustomizations to the proper clusters:
forclin cluster{0..2};do kubectl apply --context"kind-${cl}" -k"./config/${cl}/"{default,kube-system}done
- Get the
Kustomizationresources the cluster0 flux-system uses to apply to the other clusters - Use the
kubectl --contextflag to switch betweenkind-cluster0|1|2on demand - Check that the serf and calico dameonsets and deploys become ready
- Check out the Corefile ConfigMap extensions in kube-system
- Examine the
BGPPeerresources that the serf-query controller created from the serf member list - Exec into the debug pods for each cluster and run
host podinfo.default.svc.cluster1.lan - Try curling the service from and to different clusters!
kind/cleanup.sh
Check out this next demo featuring Flux's GPG signature verification and remote-cluster management over Cluster API:stealthybox/capi-flux-demo
About
Demo gossiping Kubernetes clusters that share routes in a mesh and dns-forward their Services to each other :)
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.