Install EdgeMesh
EdgeMesh environment preparation (both cloud/edge)
This Step may occur Question 6:TLSStreamPrivateKeyFile not exist
Step 1: Remove the taint on the master node.
kubectl taint nodes --all node-role.kubernetes.io/master-
Step 2: Add filter tags to Kubernetes API services.
kubectl label services kubernetes service.edgemesh.kubeedge.io/service-proxy-name=""
Step 3: Enable Kube-API endpoint service of KubeEdge on edges.
On the cloud, enable dynamicController
:
vim /etc/kubeedge/config/cloudcore.yaml
# Modify cloudcore.yaml
modules:
..
cloudStream:
enable: true
streamPort: 10003
..
dynamicController:
enable: true
# Restart cloucore
systemctl restart cloudcore.service
On the edges, enable metaServer
and edgeStream
(note that this operation should redo after keadm reset
).
vim /etc/kubeedge/config/edgecore.yaml
# Modify edgecore.yaml
edgeStream:
enable: true
handshakeTimeout: 30
readDeadline: 15
server: 192.168.0.139:10004
tlsTunnelCAFile: /etc/kubeedge/ca/rootCA.crt
tlsTunnelCertFile: /etc/kubeedge/certs/server.crt
tlsTunnelPrivateKeyFile: /etc/kubeedge/certs/server.key
writeDeadline: 15
...
metaManager:
metaServer:
enable: true
...
# Restart edgecore
systemctl restart edgecore.service
# Check running state
journalctl -u edgecore.service -f
Step 4: On the edge, test whether the edge Kube-API endpoint functions normally.
# Execute on edges
curl 127.0.0.1:10550/api/v1/services
If the return value is an empty list, or it takes a long time (close to 10 seconds) to receive the return value, it indicates that there may be an error in the configuration, please check it carefully.
Start EdgeMesh (both cloud/edge)
This is a hot spot for problems, when encountering issues, please refer to the EdgeMesh official manual for troubleshooting:
Deploy edgemesh-agent (cloud)
Download edgemesh code:
# clone edgemesh code (customized by dayu)
git clone https://github.com/dayu-autostreamer/dayu-edgemesh.git
# move in code directory
cd dayu-edgemesh
Add relay node
:
vim build/agent/resources/04-configmap.yaml
# Add the master node (cloud) as relay node for cloud-edge communication:
....
edgeTunnel:
enable: true
relayNodes:
- nodeName: <hostname>
advertiseAddress:
- <ip>
....
# Fulfill <hostname> <ip> with hostname and ip of the cloud.
Deploy edgemesh:
# Deploy crd files
kubectl apply -f build/crds/istio/
# Deploy edgemesh-agent
kubectl apply -f build/agent/resources/
NOTE: If using the Intranet Image Repository, please modify the image in the yaml file, such as:
dayuhub/edgemesh-gateway:v1.0 -> repo:5000/dayuhub/edgemesh-gateway:v1.0
Configure edge network (edge)
Configure the edge:
vim /etc/kubeedge/config/edgecore.yaml
# Modify edgecore.yaml
edged:
clusterDNS: 169.254.96.16
clusterDomain: cluster.local
Restart edgecore:
systemctl restart edgecore
Check running state
Check iptables state:
iptables -t nat -nvL
Check the state of edgemesh pods:
kubectl get pods -n kubeedge
Logs on the cloud:
kubectl logs -n kubeedge [pod-name]
Logs on the edge:
# Check edgemesh logs on the edge
kubectl logs -n kubeedge [pod-name]
Uninstall Edgemesh
If you need to reinstall Edgemesh, please uninstall it first.
cd dayu-edgemesh
kubectl delete -f build/crds/istio/
kubectl delete -f build/agent/resources/