Add Edge Nodes
Note
For more information about different components of KubeEdge, see the KubeEdge documentation.
After an edge node joins your cluster, the native KubeEdge cloud component requires you to manually configure iptables so that you can use commands such as and kubectl exec
. In this connection, KubeSphere features an efficient and convenient way to add edge nodes to a Kubernetes cluster. It uses supporting components (for example, EdgeWatcher) to automatically configure iptables.
This tutorial demonstrates how to add an edge node to your cluster.
- You have enabled .
- You have an available node to serve as an edge node. The node can run either Ubuntu (recommended) or CentOS. This tutorial uses Ubuntu 18.04 as an example.
You need to install a container runtime and configure EdgeMesh on your edge node.
KubeEdge supports several container runtimes including Docker, containerd, CRI-O and Virtlet. For more information, see .
Configure EdgeMesh
Perform the following steps to configure on your edge node.
Edit
/etc/nsswitch.conf
.Add the following content to this file:
hosts: dns files mdns4_minimal [NOTFOUND=return]
-
sudo echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
Verify your modification:
Expected result:
net.ipv4.ip_forward = 1
To make sure edge nodes can successfully talk to your cluster, you must forward ports for outside traffic to get into your network. Specifically, map an external port to the corresponding internal IP address (master node) and port based on the table below. Besides, you also need to create firewall rules to allow traffic to these ports (10000
to 10004
).
Log in to the console as
admin
and click Platform in the top left corner.Select Cluster Management and navigate to Edge Nodes under Node Management.
Note
If you have enabled multi-cluster management, you need to select a cluster first.
Copy the command automatically created under Add Command and run it on your edge node.
Note
Close the dialog, refresh the page, and the edge node will appear in the list.
Note
After an edge node is added, if you cannot see CPU and memory resource usage on the Edge Nodes page, make sure 0.4.1 or later is installed in your cluster.
Before you remove an edge node, delete all your workloads running on it.
On your edge node, run the following commands:
./keadm reset
rm -rf /var/lib/kubeedge /var/lib/edged /etc/kubeedge/ca /etc/kubeedge/certs
Note
If you cannot delete the tmpfs-mounted folder, restart the node or unmount the folder first.
Run the following command to remove the edge node from your cluster:
kubectl delete node <edgenode-name>