Skip to content

Commit 6614b79

Browse files
authored
Merge pull request #23 from Poorunga/main
update readme
2 parents 2522dbe + 5b966fe commit 6614b79

File tree

2 files changed

+43
-45
lines changed

2 files changed

+43
-45
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Before using EdgeMesh, you need to understand the following prerequisites at fir
170170

171171
#### Deployment
172172

173-
At the edge node, close EdgeMesh, open metaserver, and restart edgecore
173+
At the edge node, close edgeMesh module, open metaServer module, and restart edgecore
174174

175175
```shell
176176
$ vim /etc/kubeedge/config/edgecore.yaml
@@ -188,7 +188,7 @@ modules:
188188
$ systemctl restart edgecore
189189
```
190190

191-
On the cloud, open the dynamic controller module, and restart cloudcore
191+
On the cloud, open the dynamicController module, and restart cloudcore
192192

193193
```shell
194194
$ vim /etc/kubeedge/config/cloudcore.yaml
@@ -199,26 +199,27 @@ modules:
199199
..
200200
```
201201

202-
At the edge node, check if list-watch works
203202

204203
```shell
205-
$ curl 127.0.0.1:10550/api/v1/services
206-
{"apiVersion":"v1","items":[{"apiVersion":"v1","kind":"Service","metadata":{"creationTimestamp":"2021-04-14T06:30:05Z","labels":{"component":"apiserver","provider":"kubernetes"},"name":"kubernetes","namespace":"default","resourceVersion":"147","selfLink":"default/services/kubernetes","uid":"55eeebea-08cf-4d1a-8b04-e85f8ae112a9"},"spec":{"clusterIP":"10.96.0.1","ports":[{"name":"https","port":443,"protocol":"TCP","targetPort":6443}],"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}},{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/port":"9153","prometheus.io/scrape":"true"},"creationTimestamp":"2021-04-14T06:30:07Z","labels":{"k8s-app":"kube-dns","kubernetes.io/cluster-service":"true","kubernetes.io/name":"KubeDNS"},"name":"kube-dns","namespace":"kube-system","resourceVersion":"203","selfLink":"kube-system/services/kube-dns","uid":"c221ac20-cbfa-406b-812a-c44b9d82d6dc"},"spec":{"clusterIP":"10.96.0.10","ports":[{"name":"dns","port":53,"protocol":"UDP","targetPort":53},{"name":"dns-tcp","port":53,"protocol":"TCP","targetPort":53},{"name":"metrics","port":9153,"protocol":"TCP","targetPort":9153}],"selector":{"k8s-app":"kube-dns"},"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}}],"kind":"ServiceList","metadata":{"resourceVersion":"377360","selfLink":"/api/v1/services"}}
204+
$ pkill cloudcore
205+
$ nohup /usr/local/bin/cloudcore > /var/log/kubeedge/cloudcore.log 2>&1 &
207206
```
208207

209-
Build EdgeMesh image (not necessary)
208+
At the edge node, check if list-watch works
209+
210210
```shell
211-
$ docker build -t edgemesh:0.1 -f build/Dockerfile .
211+
$ curl 127.0.0.1:10550/api/v1/services
212+
{"apiVersion":"v1","items":[{"apiVersion":"v1","kind":"Service","metadata":{"creationTimestamp":"2021-04-14T06:30:05Z","labels":{"component":"apiserver","provider":"kubernetes"},"name":"kubernetes","namespace":"default","resourceVersion":"147","selfLink":"default/services/kubernetes","uid":"55eeebea-08cf-4d1a-8b04-e85f8ae112a9"},"spec":{"clusterIP":"10.96.0.1","ports":[{"name":"https","port":443,"protocol":"TCP","targetPort":6443}],"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}},{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/port":"9153","prometheus.io/scrape":"true"},"creationTimestamp":"2021-04-14T06:30:07Z","labels":{"k8s-app":"kube-dns","kubernetes.io/cluster-service":"true","kubernetes.io/name":"KubeDNS"},"name":"kube-dns","namespace":"kube-system","resourceVersion":"203","selfLink":"kube-system/services/kube-dns","uid":"c221ac20-cbfa-406b-812a-c44b9d82d6dc"},"spec":{"clusterIP":"10.96.0.10","ports":[{"name":"dns","port":53,"protocol":"UDP","targetPort":53},{"name":"dns-tcp","port":53,"protocol":"TCP","targetPort":53},{"name":"metrics","port":9153,"protocol":"TCP","targetPort":9153}],"selector":{"k8s-app":"kube-dns"},"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}}],"kind":"ServiceList","metadata":{"resourceVersion":"377360","selfLink":"/api/v1/services"}}
212213
```
213214

214-
Deploy EdgeMesh
215+
Deploy edgemesh-agent
215216
```shell
216217
# Please set the subNet to the value of service-cluster-ip-range of kube-apiserver.
217218
# You can obtain the value from the /etc/kubernetes/manifests/kube-apiserver.yaml file on the master node
218-
$ kubectl apply -f build/kubernetes/edgemesh/03-configmap.yaml
219-
configmap/edgemesh-cfg created
220-
$ kubectl apply -f build/kubernetes/edgemesh/04-daemonset.yaml
221-
daemonset.apps/edgemesh created
219+
$ kubectl apply -f build/agent/kubernetes/edgemesh-agent/03-configmap.yaml
220+
configmap/edgemesh-agent-cfg created
221+
$ kubectl apply -f build/agent/kubernetes/edgemesh-agent/04-daemonset.yaml
222+
daemonset.apps/edgemesh-agent created
222223
```
223224

224225

@@ -279,7 +280,7 @@ $ ./client --addr ws-svc.edgemesh-test:12348
279280
The capability of load balance needs to add the CRD 'DestinationRule'
280281

281282
```shell
282-
$ kubectl apply -f build/istio/destinationrule-crd.yaml
283+
$ kubectl apply -f build/crds/istio/destinationrule-crd.yaml
283284
customresourcedefinition.apiextensions.k8s.io/destinationrules.networking.istio.io created
284285
```
285286

@@ -299,7 +300,7 @@ spec
299300

300301
## EdgeMesh Ingress Gateway
301302

302-
EdgeMesh ingress gateway provides a ability to access services in external edge nodes.
303+
EdgeMesh ingress gateway provides an ability to access services in external edge nodes.
303304

304305
![](./images/em-ig.png)
305306

@@ -308,18 +309,18 @@ EdgeMesh ingress gateway provides a ability to access services in external edge
308309
Create two CRDs: 'Gateway' and 'VirtualService'
309310

310311
```shell
311-
$ kubectl apply -f build/istio/gateway-crd.yaml
312+
$ kubectl apply -f build/crds/istio/gateway-crd.yaml
312313
customresourcedefinition.apiextensions.k8s.io/gateways.networking.istio.io created
313-
$ kubectl apply -f build/istio/virtualservice-crd.yaml
314+
$ kubectl apply -f build/crds/istio/virtualservice-crd.yaml
314315
customresourcedefinition.apiextensions.k8s.io/virtualservices.networking.istio.io created
315316
```
316317

317318
Deploy edgemesh-gateway
318319

319320
```shell
320-
$ kubectl apply -f 03-configmap.yaml
321+
$ kubectl apply -f build/agent/kubernetes/edgemesh-gateway/03-configmap.yaml
321322
configmap/edgemesh-gateway-cfg created
322-
$ kubectl apply -f 04-deployment.yaml
323+
$ kubectl apply -f build/agent/kubernetes/edgemesh-gateway/04-deployment.yaml
323324
deployment.apps/edgemesh-gateway created
324325
```
325326

@@ -335,15 +336,15 @@ destinationrule.networking.istio.io/hostname-lb-edge created
335336
virtualservice.networking.istio.io/edgemesh-gateway-svc created
336337
```
337338

338-
Check if the edgemesh-gateway is successfully deployed
339+
Check if the edgemesh-gateway is successfully created
339340

340341
```shell
341342
$ kubectl get gw -n edgemesh-test
342343
NAME AGE
343344
edgemesh-gateway 3m30s
344345
```
345346

346-
Finally, use the IP and the port exposed by the VirtualService to access
347+
Finally, use the IP and the port exposed by the Gateway to access
347348

348349
```shell
349350
$ curl 192.168.0.211:12345
@@ -396,4 +397,3 @@ $ curl -k --cert ./tls.crt --key ./tls.key https://192.168.0.129:12345
396397
If you need support, start with the 'Operation Guidance', and then follow the process that we've outlined
397398

398399
If you have any question, please contact us through the recommended information on [KubeEdge](https://github.com/kubeedge/kubeedge#contact)
399-

README_zh.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ EdgeMesh 满足边缘场景下的新需求(如边缘资源有限,边云网
151151

152152
#### **工作原理**
153153

154-
- EdgeMesh 通过 KubeEdge 边缘侧 list-watch 的能力,监听Service、Endpoints等元数据的增删改,再根据 Service、EndPoints 的信息创建iptables规则
154+
- EdgeMesh 通过 KubeEdge 边缘侧 list-watch 的能力,监听Service、Endpoints等元数据的增删改,再根据 Service、Endpoints 的信息创建iptables规则
155155
- EdgeMesh 使用与 K8s Service 相同的 Cluster IP 和域名的方式来访问服务
156156
- 当 client 访问服务的请求到达带有EdgeMesh的节点后,它首先会进入内核的 iptables
157157
- EdgeMesh 之前配置的 iptables 规则会将请求重定向,全部转发到 EdgeMesh 进程的40001端口里(数据包从内核态->用户态)
@@ -161,7 +161,7 @@ EdgeMesh 满足边缘场景下的新需求(如边缘资源有限,边云网
161161

162162
## 入门指南
163163
#### 预备知识
164-
在使用edgemesh之前,您需要先了解以下预备知识:
164+
在使用EdgeMesh之前,您需要先了解以下预备知识:
165165

166166
- 使用 EdgeMesh 能力时,必须要求 Pod 要开启一个 HostPort,例子可看 /examples/ 目录下面的文件
167167
- 使用 DestinationRule 时,要求 DestinationRule 的名字与相应的 Service 的名字要一致,EdgeMesh 会根据 Service 的名字来确定同命名空间下面的DestinationRule
@@ -171,7 +171,7 @@ EdgeMesh 满足边缘场景下的新需求(如边缘资源有限,边云网
171171

172172
#### 部署
173173

174-
在边缘节点,关闭 edgemesh,打开 metaserver,并重启 edgecore
174+
在边缘节点,关闭 edgeMesh模块,打开 metaServer模块,并重启 edgecore
175175

176176
```shell
177177
$ vim /etc/kubeedge/config/edgecore.yaml
@@ -189,7 +189,7 @@ modules:
189189
$ systemctl restart edgecore
190190
```
191191

192-
在云端,开启 dynamic controller 模块,并重启 cloudcore
192+
在云端,开启 dynamicController 模块,并重启 cloudcore
193193

194194
```shell
195195
$ vim /etc/kubeedge/config/cloudcore.yaml
@@ -200,29 +200,28 @@ modules:
200200
..
201201
```
202202

203-
在边缘节点,查看 list-watch 是否开启
204203

205204
```shell
206-
$ curl 127.0.0.1:10550/api/v1/services
207-
{"apiVersion":"v1","items":[{"apiVersion":"v1","kind":"Service","metadata":{"creationTimestamp":"2021-04-14T06:30:05Z","labels":{"component":"apiserver","provider":"kubernetes"},"name":"kubernetes","namespace":"default","resourceVersion":"147","selfLink":"default/services/kubernetes","uid":"55eeebea-08cf-4d1a-8b04-e85f8ae112a9"},"spec":{"clusterIP":"10.96.0.1","ports":[{"name":"https","port":443,"protocol":"TCP","targetPort":6443}],"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}},{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/port":"9153","prometheus.io/scrape":"true"},"creationTimestamp":"2021-04-14T06:30:07Z","labels":{"k8s-app":"kube-dns","kubernetes.io/cluster-service":"true","kubernetes.io/name":"KubeDNS"},"name":"kube-dns","namespace":"kube-system","resourceVersion":"203","selfLink":"kube-system/services/kube-dns","uid":"c221ac20-cbfa-406b-812a-c44b9d82d6dc"},"spec":{"clusterIP":"10.96.0.10","ports":[{"name":"dns","port":53,"protocol":"UDP","targetPort":53},{"name":"dns-tcp","port":53,"protocol":"TCP","targetPort":53},{"name":"metrics","port":9153,"protocol":"TCP","targetPort":9153}],"selector":{"k8s-app":"kube-dns"},"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}}],"kind":"ServiceList","metadata":{"resourceVersion":"377360","selfLink":"/api/v1/services"}}
205+
$ pkill cloudcore
206+
$ nohup /usr/local/bin/cloudcore > /var/log/kubeedge/cloudcore.log 2>&1 &
208207
```
209208

210-
构建 edgemesh 容器镜像 (非必须)
209+
在边缘节点,查看 list-watch 是否开启
211210

212211
```shell
213-
# 在项目目录下执行如下操作
214-
$ docker build -t edgemesh:0.1 -f build/Dockerfile .
212+
$ curl 127.0.0.1:10550/api/v1/services
213+
{"apiVersion":"v1","items":[{"apiVersion":"v1","kind":"Service","metadata":{"creationTimestamp":"2021-04-14T06:30:05Z","labels":{"component":"apiserver","provider":"kubernetes"},"name":"kubernetes","namespace":"default","resourceVersion":"147","selfLink":"default/services/kubernetes","uid":"55eeebea-08cf-4d1a-8b04-e85f8ae112a9"},"spec":{"clusterIP":"10.96.0.1","ports":[{"name":"https","port":443,"protocol":"TCP","targetPort":6443}],"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}},{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/port":"9153","prometheus.io/scrape":"true"},"creationTimestamp":"2021-04-14T06:30:07Z","labels":{"k8s-app":"kube-dns","kubernetes.io/cluster-service":"true","kubernetes.io/name":"KubeDNS"},"name":"kube-dns","namespace":"kube-system","resourceVersion":"203","selfLink":"kube-system/services/kube-dns","uid":"c221ac20-cbfa-406b-812a-c44b9d82d6dc"},"spec":{"clusterIP":"10.96.0.10","ports":[{"name":"dns","port":53,"protocol":"UDP","targetPort":53},{"name":"dns-tcp","port":53,"protocol":"TCP","targetPort":53},{"name":"metrics","port":9153,"protocol":"TCP","targetPort":9153}],"selector":{"k8s-app":"kube-dns"},"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}}],"kind":"ServiceList","metadata":{"resourceVersion":"377360","selfLink":"/api/v1/services"}}
215214
```
216215

217-
部署 edgemesh 组件
216+
部署 edgemesh-agent 组件
218217

219218
```shell
220219
# 请将03-configmap.yaml里面的subNet配置成kube-apiserver的service-cluster-ip-range的值
221220
# 你可以在k8s master节点上的/etc/kubernetes/manifests/kube-apiserver.yaml文件中找到这个配置项的值
222-
$ kubectl apply -f build/kubernetes/edgemesh/03-configmap.yaml
223-
configmap/edgemesh-cfg created
224-
$ kubectl apply -f build/kubernetes/edgemesh/04-daemonset.yaml
225-
daemonset.apps/edgemesh created
221+
$ kubectl apply -f build/agent/kubernetes/edgemesh-agent/03-configmap.yaml
222+
configmap/edgemesh-agent-cfg created
223+
$ kubectl apply -f build/agent/kubernetes/edgemesh-agent/04-daemonset.yaml
224+
daemonset.apps/edgemesh-agent created
226225
```
227226

228227

@@ -282,7 +281,7 @@ $ ./client --addr ws-svc.edgemesh-test:12348
282281

283282
负载均衡功能需要添加 DestinationRule 用户自定义资源
284283
```shell
285-
$ kubectl apply -f build/istio/destinationrule-crd.yaml
284+
$ kubectl apply -f build/crds/istio/destinationrule-crd.yaml
286285
customresourcedefinition.apiextensions.k8s.io/destinationrules.networking.istio.io created
287286
```
288287

@@ -311,22 +310,22 @@ EdgeMesh ingress gateway 提供了外部访问集群里服务的能力。
311310
创建 Gateway 和 VirtualService 用户自定义资源
312311

313312
```shell
314-
$ kubectl apply -f build/istio/gateway-crd.yaml
313+
$ kubectl apply -f build/crds/istio/gateway-crd.yaml
315314
customresourcedefinition.apiextensions.k8s.io/gateways.networking.istio.io created
316-
$ kubectl apply -f build/istio/virtualservice-crd.yaml
315+
$ kubectl apply -f build/crds/istio/virtualservice-crd.yaml
317316
customresourcedefinition.apiextensions.k8s.io/virtualservices.networking.istio.io created
318317
```
319318

320319
部署 edgemesh-gateway
321320

322321
```shell
323-
$ kubectl apply -f build/kubernetes/edgemesh-gateway/03-configmap.yaml
322+
$ kubectl apply -f build/agent/kubernetes/edgemesh-gateway/03-configmap.yaml
324323
configmap/edgemesh-gateway-cfg created
325-
$ kubectl apply -f build/kubernetes/edgemesh-gateway/04-deployment.yaml
324+
$ kubectl apply -f build/agent/kubernetes/edgemesh-gateway/04-deployment.yaml
326325
deployment.apps/edgemesh-gateway created
327326
```
328327

329-
创建 gateway 资源对象和路由规则 VirtualService
328+
创建 Gateway 资源对象和路由规则 VirtualService
330329

331330
```shell
332331
$ kubectl apply -f example/hostname-lb-random-gateway.yaml
@@ -338,15 +337,15 @@ destinationrule.networking.istio.io/hostname-lb-edge created
338337
virtualservice.networking.istio.io/edgemesh-gateway-svc created
339338
```
340339

341-
查看 edgemesh-gateway 是否部署成功
340+
查看 edgemesh-gateway 是否创建成功
342341

343342
```shell
344343
$ kubectl get gw -n edgemesh-test
345344
NAME AGE
346345
edgemesh-gateway 3m30s
347346
```
348347

349-
最后,使用 IP 和 VirtualService 暴露的端口来进行访问
348+
最后,使用 IP 和 Gateway 暴露的端口来进行访问
350349

351350
```shell
352351
$ curl 192.168.0.211:12345
@@ -395,4 +394,3 @@ $ curl -k --cert ./tls.crt --key ./tls.key https://192.168.0.129:12345
395394
如果您需要支持,请从 '操作指导' 开始,然后按照我们概述的流程进行操作。
396395

397396
如果您有任何疑问,请通过 [KubeEdge官网](https://github.com/kubeedge/kubeedge#contact) 推荐的联系方式与我们联系
398-

0 commit comments

Comments
 (0)