This document uses an example to demonstrate how to use the Submariner
to connect the network between member clusters.
Submariner flattens the networks between the connected clusters, and enables IP reachability between Pods and Services.
Following the steps Install karmada control plane in Quick Start, you can get a Karmada.
In the following steps, we are going to create a member cluster and then join the cluster to karmada control plane.
- Create member cluster
We are going to create a cluster named cluster1
and we want the KUBECONFIG file in $HOME/.kube/cluster.config. Run following command:
# hack/create-cluster.sh cluster1 $HOME/.kube/cluster1.config
This will create a cluster by kind.
- Join member cluster to karmada control plane
Export KUBECONFIG
and switch to karmada apiserver
:
# export KUBECONFIG=$HOME/.kube/karmada.config
# kubectl config use-context karmada-apiserver
Then, install karmadactl
command and join the member cluster:
# go install github.com/karmada-io/karmada/cmd/karmadactl
# karmadactl join cluster1 --cluster-kubeconfig=$HOME/.kube/cluster1.config
In addition to the original member clusters, ensure that at least two member clusters are joined to the Karmada.
In this example, we have joined two member clusters to the Karmada:
# kubectl get clusters
NAME VERSION MODE READY AGE
cluster1 v1.21.1 Push True 16s
cluster2 v1.21.1 Push True 5s
...
We are going to deploy Submariner
componnets on the host cluster
and member clusters
by using the subctl
CLI as it's the recommended deployment method according to Submariner official documentation.
Submariner
uses a central Broker component to facilitate the exchange of metadata information between Gateway Engines deployed in participating clusters. The Broker must be deployed on a single Kubernetes cluster. This cluster’s API server must be reachable by all Kubernetes clusters connected by Submariner, therefore, we deployed it on the karmada-host cluster.
Please refer to the SUBCTL Installation.
subctl deploy-broker --kubeconfig /root/.kube/karmada.config --kubecontext karmada-host
subctl join --kubeconfig /root/.kube/cluster1.config broker-info.subm --natt=false
subctl join --kubeconfig /root/.kube/cluster2.config broker-info.subm --natt=false
Please refer to the Multi-cluster Service Discovery.