Edge connection with EdgeMesh
Check more details at edgemesh website to use EdgeMesh.
Assume we have two edge nodes in ready state, we call them edge node “a” and “b”:
Deploy a sample pod from Cloud Side:
deployment.apps/nginx-deployment created
Check if it works:
$ curl 172.17.0.2
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
</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="https://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="https://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</html>
172.17.0.2
is the IP of deployment and the output may be different since the version of nginx image is different.
Then create a service for it:
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-svc ClusterIP 10.96.191.183 <none> 12345/TCP 77m
$ kubectl get endpoints
NAME ENDPOINTS AGE
nginx-svc 172.17.0.2:80 81m
To request a server, use url like this: <service_name>.<service_namespace>.svc.<cluster>.<local>:<port>
In our case, from edge node a or b, run following command:
- One service
- One or more pods’ labels match the service’s selector
- To request a server, use: :
- get the service’s name and namespace from domain name
- LoadBalance returns the real backend containers’ hostIP and hostPort