submariner实现多集群pod互通
k8s集群pod互通
·
实现Kubernetes跨集群网络
Submariner为部署在Prem上或云端的不同Kubernetes集群中的pod提供网络连接,解决了Kubernetes集群之间的连接障碍。
1、注意事项
1、Minimum supported Kubernetes version is 1.17.
2、Submariner only supports kube-proxy in iptables mode. IPVS is not supported at this time.
3、CoreDNS is supported out of the box for *.clusterset.local service discovery. KubeDNS needs manual configuration. Please refer to the GKE Quickstart Guide for more information.
4、Clusters deployed with the Calico network plug-in require further configuration to be compatible with Submariner. Please refer to the Calico-specific deployment instructions.
2、使用subctl部署架构
3、部署步骤
1、部署brokers: subctl deploy-broker --kubeconfig kubeconfig-cluster-a(kubeconfig中的context name和kubeconfig-cluster-a中的cluster-a一致)
2、将集群加入broker: subctl join --kubeconfig kubeconfig-cluster-a broker-info.subm --clusterid cluster-a
subctl join --kubeconfig kubeconfig-cluster-b broker-info.subm --clusterid cluster-b
4、验证部署结果
1、
$ export KUBECONFIG=cluster1/auth/kubeconfig
$ kubectl config use-context cluster1
Switched to context "cluster1".
2、kubectl get crds | grep -iE 'submariner|multicluster.x-k8s.io'
clusters.submariner.io 2020-11-30T13:49:16Z
endpoints.submariner.io 2020-11-30T13:49:16Z
gateways.submariner.io 2020-11-30T13:49:16Z
serviceexports.multicluster.x-k8s.io 2020-11-30T13:52:39Z
serviceimports.multicluster.x-k8s.io 2020-11-30T13:52:39Z
3、查看已经加入的集群
kubectl -n submariner-k8s-broker get clusters.submariner.io
4、查看gateway的相关信息
kubectl -n submariner-operator describe Gateway
5、查看lightdns是否正常
kubectl -n submariner-operator get service submariner-lighthouse-coredns
kubectl -n kube-system describe configmap coredns
如以上检查均正常则部署正常,相关的pod能互相ping通,svc能访问不能ping通。
如果一个集群想要访问另外一个集群中的服务那么需要把服务进行一次暴露
subctl export service --namespace nginx-test nginx
kubectl -n nginx-test describe serviceexports
在其他集群查看暴露的服务
kubectl get -n submariner-operator serviceimport
curl nginx.nginx-test.svc.clusterset.local:8080(可以直接访问注意是clusterset)
重brokers中删除已添加的集群
subctl uninstall --kubeconfig /data/kubeconfig-cluster-a
更多推荐
已为社区贡献14条内容
所有评论(0)