For services in child clusters, we can use service name to visit them locally from any child cluster.
FleetBoard
first follow the Fleetboard Helm Docs you
should install fleetboard
in Hub
cluster and install fleetboard-agent
in Child
clusters. fleetboard.local:53 {
forward . 10.96.0.11
}
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
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>
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.