百度智能云

All Product Document

          Intelligent Edge

          Quick Start Guide

          Create edge nodes in the Baidu AI Cloud

          Open the Edge Node page.

          image.png

          Click Create Node to pop up the interface as follows:

          image.png

          Fill in the edge node information:

          • Name: It cannot be empty or duplicated.
          • Description: Description, which can be empty.
          • Tag: KV pair, optional
          • Authentication mode: Certificate authentication by default

          ## Edge node environment preparation

          The BIE edge computing framework relies on the k3s/k8s environment. Considering the resource constraint of edge nodes into account, k3s is recommended. k3s is a lightweight k8s designed for edge computing, and it retains the core features of k8s.

          The container runtime of k3s can use the docker or containerd. This section describes how to install k3s and the corresponding runtime.


          ### Disable swap

          For the sake of performance, swap shall be disabled in advance whether k3s and k8s are installed.

          Temporary disabling

          • Disable command: sudo swapoff -a
          • Enable command: sudo swapon -a
          • View the status of swap: sudo free -m

          image.png

          Permanently disabled

          After the swap is permanently disabled, you need to restart the system. Recommend you to adjust the memory allocation of a virtual machine to over 2G. Otherwise, it is difficult to enter the graphic interface.

          Disabling mode:

          1. sudo vim /etc/fstab
          2. Comment on the swap line.

          image.png

          Install k3s+containerd.

          The default container runtime of k3s is containerd. Execute the following command to install and start k3s and containerd automatically.

          curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn INSTALL_K3S_EXEC="--write-kubeconfig ~/.kube/config --write-kubeconfig-mode 666" sh -

          ### Install k3s+docker.

          If you need to use docker as the container runtime of k3s, it is necessary to install the docker environment firstly, and then execute the following command to install docker:

          # Install a docker
          curl -sSL https://get.daocloud.io/docker | sh
          # Execute the docker command sudo
          sudo usermod -aG docker "$USER"
          # Check the docker information
          docker info

          Execute the following command to install k3s, and use docker as the default container runtime to start k3s:

          curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn INSTALL_K3S_EXEC="--docker --write-kubeconfig ~/.kube/config --write-kubeconfig-mode 666" sh -

          image.png


          ## Install the edge computing framework.

          Click "Edge Node" to enter the Node Details interface, and click Install as shown in the figure below.

          image.png

          Copy the edge computing framework installation command in the pop-up box as shown in the figure below:

          image.png

          Execute the online installation command at the edge node. The command will download the custom installation package and perform the installation where the edge device can connect to the Internet.

          image.png


          ## Verify whether to install the edge computing framework successfully.

          After installing the edge computing framework successfully, execute the following command:

          sudo kubectl get pod -A

          Check whether this pod, i.e., baetyl-core, gets started properly. As shown in the figure below, the baetyl-core is in the Running state, indicating the success in installing the edge computing framework.

          image.png

          You can view the log and description of baetyl-core through the following command.

          sudo kubectl logs baetyl-core-5c976fc55-7dsvq -n baetyl-edge-system
          sudo kubectl describe baetyl-core-5c976fc55-7dsvq -n baetyl-edge-system

          Note: The final random number of baetyl-core-5c976fc55-7dsvq should be replaced with the actual value.

          View edge nodes in the Baidu AI Cloud

          After successful creation, click "Edge Node" to enter the Node Details interface. You can view the Node Information and Application Deployment Information.

          Node information

          The node information mainly includes:

          • System Information

            • CVM server name
            • CVM server ID
            • Operating system
            • CPU architecture: such as arm64 and amd64
            • Hardware rules: Memory capacity and CPU cores
            • Network information: Edge node IP
            • baetyl version information: Current version vs latest version
            • Container version: docker and containerd
          • Resources Monitoring

            • CPU utilization
            • Memory usage rate
          • Node tag

            • Edge node tag, which contains a system tag of baetyl-node-name by default.

          image.png

          Application Deployment

          The application deployment information includes:

          • Application status

            • Application name
            • Application version number
            • Apply target node tag
            • Deployment status: Deployed, deploying, deployment failed
            • Creation Time
          • Service status

            • Service name
            • Service replica name: A service may have multiple replicas, Replica name = Service name + Random number.
            • Running status
            • Memory: Memory size used by service replica
            • CPU: CPU cores used by replica
            • Affiliated application: Application to which service belongs

          image.png


          Previous
          Install k3s+docker Offline
          Next
          Operation Guide