Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo: cross-edge-cloud communication between pods #44

Closed
Poorunga opened this issue Aug 18, 2021 · 3 comments
Closed

Demo: cross-edge-cloud communication between pods #44

Poorunga opened this issue Aug 18, 2021 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Poorunga
Copy link
Member

Poorunga commented Aug 18, 2021

KubeEdge community meeting Aug 18th, 2021 (Europe Time)

Today my topic is EdgeMesh: Cross-edge-cloud communication between pods demo. And I am here to make a brief summary of what was said at the meeting.

My Cluster Environment:

image

k8s-master is a k8s control-plane and also a k8s worker. k8s-node1 is a k8s worker. ke-edge1 and ke-edge2 are edge nodes of kubeedge, and they access the Internet through a NAT.

[root@k8s-master ~]# kubectl get nodes
NAME         STATUS   ROLES           AGE     VERSION
k8s-master   Ready    master,worker   3d18h   v1.18.20
k8s-node1    Ready    worker          3d18h   v1.18.20
ke-edge1     Ready    agent,edge      25h     v1.19.3-kubeedge-v1.7.2
ke-edge2     Ready    agent,edge      25h     v1.19.3-kubeedge-v1.7.2

edgemesh-server is deployed on the cloud node, and has a public IP. edgemesh-agent is divided into two parts: cloud and edge.

[root@k8s-master ~]# kubectl get all -n kubeedge
NAME                                   READY   STATUS    RESTARTS   AGE
pod/edgemesh-agent-cloud-dkwwc         1/1     Running   0          74m
pod/edgemesh-agent-cloud-rl6pq         1/1     Running   0          74m
pod/edgemesh-agent-edge-jr5xs          1/1     Running   0          23h
pod/edgemesh-agent-edge-kbzhh          1/1     Running   0          23h
pod/edgemesh-server-7f97d77469-dml4j   1/1     Running   0          83m

NAME                                  DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/edgemesh-agent-cloud   2         2         2       2            2           <none>          74m
daemonset.apps/edgemesh-agent-edge    2         2         2       2            2           <none>          23h

NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/edgemesh-server   1/1     1            1           83m

NAME                                         DESIRED   CURRENT   READY   AGE
replicaset.apps/edgemesh-server-7f97d77469   1         1         1       83m

My Test Case

image

tcp-echo-edge and busybox-edge are deployed in the edgezone namespace. tcp-echo-cloud and busybox-cloud are deployed in the cloudzone namespace. busybox-edge is used to access tcp-echo-cloud-svc. busybox-cloud is used to access tcp-echo-edge-svc.

[root@k8s-master ~]# kubectl get all -n cloudzone
NAME                      READY   STATUS    RESTARTS   AGE
pod/busybox-sleep-cloud   1/1     Running   0          23m
pod/tcp-echo-cloud        1/1     Running   0          23m

NAME                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/tcp-echo-cloud-svc   ClusterIP   10.98.233.235   <none>        2701/TCP   23m

[root@k8s-master ~]# kubectl get all -n edgezone
NAME                     READY   STATUS    RESTARTS   AGE
pod/busybox-sleep-edge   1/1     Running   7          23h
pod/tcp-echo-edge        1/1     Running   0          24h

NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
service/tcp-echo-edge-svc   ClusterIP   10.106.241.223   <none>        2701/TCP   24h

Start Playing

Cloud access edge

[root@k8s-master ~]# kubectl exec -it pod/busybox-sleep-cloud sh -n cloudzone
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl kubectl exec [POD] -- [COMMAND] instead.
/ # telnet tcp-echo-edge-svc.edgezone 2701
Welcome, you are connected to node ke-edge1.
Running on Pod tcp-echo-edge.
In namespace edgezone.
With IP address 172.17.0.2.
Service default.
I'm cloud busybox
I'm cloud busybox

Edge access cloud

[root@ke-edge1 ~]# docker exec -it b4f1820ba1f6 sh
/ # telnet tcp-echo-cloud-svc.cloudzone 2701
Welcome, you are connected to node k8s-master.
Running on Pod tcp-echo-cloud.
In namespace cloudzone.
With IP address 10.244.0.7.
Service default.
I'm edge busybox
I'm edge busybox

Traffic forwarding path

hole-punching successful: busybox --> edgemesh-agent(1) --> edgemesh-agent(2) --> tcp-echo
hole-punching failure: busybox --> edgemesh-agent(1) --> edgemesh-server(reley) --> edgemesh-agent(2) --> tcp-echo

All yaml files in PR: #57 🐱‍🏍

@Poorunga Poorunga added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 18, 2021
@Poorunga
Copy link
Member Author

/close

@kubeedge-bot
Copy link
Collaborator

@Poorunga: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zz952332446
Copy link

hello, I wonder what are the differences between k8s-master and k8s-node1? It seems that they are both cloud nodes.
Are there some differences when they are configured? I only configure a kubeedge cluster with the roles of master and edge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants