Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Demo gossiping Kubernetes clusters that share routes in a mesh and dns-forward their Services to each other :)

NotificationsYou must be signed in to change notification settings

stealthybox/multicluster-gitops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

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 :)

Requirements:

  1. your computer
  2. these tools
    • git
    • hub (optional)
    • flux
    • docker
    • kind
    • kubectl

Let's go

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

Looking around

  • Get theKustomization resources the cluster0 flux-system uses to apply to the other clusters
  • Use thekubectl --context flag to switch betweenkind-cluster0|1|2 on demand
  • Check that the serf and calico dameonsets and deploys become ready
  • Check out the Corefile ConfigMap extensions in kube-system
  • Examine theBGPPeer resources that the serf-query controller created from the serf member list
  • Exec into the debug pods for each cluster and runhost podinfo.default.svc.cluster1.lan
  • Try curling the service from and to different clusters!

Tidying Up

kind/cleanup.sh

More demos!

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp