Batch Onboard Edge Nodes¶
This document describes how to onboard multiple edge nodes into the system by using a batch task. With the batch onboarding feature, you can:
- Onboard nodes in batches, significantly improving operation and maintenance efficiency
- Reduce operation and maintenance costs and simplify the operation process
Prerequisites¶
Before you start to onboard edge nodes in batches, make sure that:
- A control node has been prepared, and this node needs to be able to access all edge nodes to be onboarded.
- The Cloud Edge Collaboration module has been upgraded to v0.20.0 or a later version.
About the keadm Initialization Script¶
To simplify the initialization of the keadm tool, we provide a handy initialization script named keadm_init.sh. You can go to the Download Center to download the script file.
The script supports the following two important parameters:
MULTI_ARCH: controls whether nodes with multiple architectures can be onboardedfalse: only nodes with the same architecture as the control node can be onboardedtrue: nodes with both the amd64 and arm64 architectures can be onboarded
WITH_CONTAINERD: controls whether containerd is installed automaticallyfalse: do not install containerd automaticallytrue: install the default version of containerd on the node automatically
Steps to Onboard Nodes in Batches¶
Online Mode¶
-
Create a working directory.
-
Run the keadm initialization script.
-
Prepare the batch configuration file and place it in the working directory.
# batch_join_config.yaml # Please modify the parameter values in <xxx> according to your actual situation # Note: if WITH_CONTAINERD=true in the keadm initialization script, keep the --pre-run=./containerd.sh parameter; otherwise, remove it keadm: download: enable: false keadmVersion: v1.20.0 archGroup: - amd64 offlinePackageDir: . cmdTplArgs: cmd: join <--pre-run=./containerd.sh> --cgroupdriver=cgroupfs --cloudcore-ipport=<master-ip>:30000 --hub-protocol=websocket --certport=30002 --image-repository=docker.m.daocloud.io/kubeedge --kubeedge-version=v1.17.0 --set modules.edgeHub.quic.server=<master-ip>:30001,modules.edgeStream.server=<master-ip>:30004,modules.edgeHub.websocket.server=<master-ip>:30000,modules.edgeStream.enable=true token: <token> nodes: - nodeName: ubuntu1 copyFrom: ./manifests keadmCmd: '{{.cmd}} --edgenode-name=<edge-node-name1> --token={{.token}}' ssh: ip: <node-ip> username: root # Log in as the root user auth: type: password passwordAuth: password: <****> - nodeName: ubuntu2 copyFrom: ./manifests keadmCmd: '{{.cmd}} --edgenode-name=<edge-node-name2> --token={{.token}}' ssh: ip: <node-ip> username: root # Log in as the root user auth: type: password passwordAuth: password: <****> maxRunNum: 5 -
Use keadm to onboard nodes in batches.
Offline Mode¶
-
Create a working directory.
-
Prepare the offline installation package and the initialization script.
Prepare the corresponding installation package and initialization script file according to your installation scenario:
# Single architecture without containerd ├── keadm-join-node └── keadm_{arch}.tar.gz └── keadm_init.sh # Single architecture with containerd ├── keadm-join-node └── keadm-containerd-{arch}.tar.gz └── keadm_init.sh # Multiple architectures without containerd ├── keadm-join-node └── keadm_amd64.tar.gz └── keadm_arm64.tar.gz └── keadm_init.sh # Multiple architectures with containerd ├── keadm-join-node └── keadm-containerd-amd64.tar.gz └── keadm-containerd-arm64.tar.gz └── keadm_init.sh -
Run the initialization script.
-
Prepare the configuration file.
Refer to the configuration description for the online mode to create the
batch-join-config.yamlfile. Make sure the directory structure is as follows: -
Run the batch onboarding command.