Balance to Services Running across Child Clusters With Fleetboard
How to make cross-cluster access to services as simple as in local cluster.
For services in child clusters, we can use service name to visit them locally from any child cluster.
Note
- Fleetboard requires no public IP for child clusters and has no pre-limits of cluster IP CIDR or CNI types of kubernetes clusters.
- Please install
FleetBoardfirst follow the Fleetboard Helm Docs you should installfleetboardinHubcluster and installfleetboard-agentinChildclusters. - After the installation, add cross cluster DNS config segment in coredns configmap, and restart coredns pods. The cluster-ip of crossdns is a static cluster IP, usually 10.96.0.11 , check before setting.
fleetboard.local:53 {
forward . 10.96.0.11
}
1. Deploying applications to multiple clusters with various scheduling strategies
Please follow this example. to deploy demo applications to at least two child clusters.
$ kubectl clusternet apply -f examples/scheduling-with-mcs-api/scheduling
namespace/baz created
deployment.apps/nginx-app created
service/nginx-svc created
serviceexport.multicluster.x-k8s.io/nginx-svc created
subscription.apps.clusternet.io/scheduling-with-mcs-api created
2. Testing service availability
Now you can check and verify the endpointslices synced by Fleetboard and the service deployed by clusternet before.
$ kubectl get endpointslice -n syncer-operator
NAME ADDRESSTYPE PORTS ENDPOINTS AGE
cluster1-baz-nginx-svc-v5vw6 IPv4 80 20.112.0.3,20.112.1.5,20.112.1.4 36h
$ kubectl exec -it nginx-app-9fb9fffdd-dsjxm -n baz -c alpine -- sh
/ # curl nginx-svc.baz.svc.fleetboard.local
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified September 23, 2024: change mcs to fleetboard (#96) (c20a9ae)