tencent cloud

Feedback

Edgectl script manual

Last updated: 2023-06-01 11:53:42
    Edgectl is an edge node management tool used for remotely adding edge nodes. You can obtain this tool by going to Node Management > Add Nodes via Script.
    Edgectl provides the following three commands:
    Command
    Description
    Check if the node meets the conditions for installing an edge node.
    Clean up the edge node.
    Install the edge node.
    The sample code is shown below:
    # ./edgectl -h
    Usage:
    edgectl command [flags]
    Available Commands:
    check Check the edge node if to be add to clusters
    install Install components to edge node
    clear Clear edge node and recovery as usual
    
    Flags:
    -h, --help Help for edgectl

    edgectl check command

    Meaning

    Check if the node meets the conditions for installing an edge node. The check project includes the following:
    Check if the user is the root user.
    Check if the system is within the supported range.
    Check if the swap area is turned off.
    Check if the firewall is turned off.
    Check if ufw is turned off.
    Check if the ports are occupied (the ports checked are 1443 and the ranges 10249-10259 and 51000-51020).
    Check if cgroup memory is enabled.
    Check if the node has previously installed kubeadm, docker, kubelet, and kubectl.

    Usage example

    # ./edgectl check
    Unit firewalld.service could not be found.
    WARN >> Port: 1443 occupied. Please turn off port service.
    ...
    WARN >> The machine is not clean. Please reinstall the system.
    /usr/bin/kubelet
    ...
    >> Check Environment Finish! <<
    For instance, after executing the sample code this time, the user is prompted with the following 2 risk items:
    The edge node's port 1443 is already in use, please shut down its service.
    WARN >> Port: 1443 occupied. Please turn off port service.
    The node has kubelet remnants. It is recommended to reinstall the node system, or execute the edgectl clear command to perform the cleanup operation.
    WARN >> The machine is not clean. Please reinstall the system.
    /usr/bin/kubelet ## The kubelet has been installed previously

    edgectl clear command

    Meaning

    Clean up the edge node. The clear command will remove the following information:
    Remove all containers and Pods running on the edge node.
    Stop kubelet, lite-apiserver, and docker.
    Remove created network information and routing information.
    Delete the following folders or files:
    /etc/kubernetes
    /etc/docker
    /root/.kube/config
    /var/lib/kubelet >/dev/null 2>&1
    /var/lib/cni
    /etc/cni
    /etc/sysconfig/kubelet/
    /etc/sysconfig/lite-apiserver
    /data/lite-apiserver >/dev/null 2>&1
    /usr/lib/systemd/system/{kubelet, docker, lite-apiserver}.service
    Note
    edgectl clear will remove all containers and Pods on the node, please execute with caution.
    edgectl clear will remove relevant folders or files, please back up important materials in advance.
    The edgectl install command will execute edgectl clear by default. Before executing edgectl install, please consider the risk items removed by edgectl clear.

    Usage example

    # ./edgectl clear
    removed '/etc/kubernetes/cluster-ca.crt'
    ...
    >> Clear Node Complete! <<

    edgectl install command

    Meaning

    Install the edge node. Execute the following command to install the edge node.
    # ./edgectl install -h
    Usage:
    edgectl install [flags]
    Flags:
    -n, --node-name Node name in edge cluster. Must!## Node name, required
    -i, --interface Default network interface name. ## Node's default network interface name, optional
    --node-name:Edge node name, abbreviated as -n.
    The name is a required option and must strictly follow the Kubernetes node naming conventions.
    Please ensure that the node name is unique within the cluster being added, otherwise, it will cause a problem of continuous switching of nodes with the same node name.
    Node names do not support using IP addresses directly, otherwise it will cause the kubectl log and kubectl exec commands to become invalid.
    --interface:The default network interface name for the edge node, abbreviated -i.
    Optional, the default network interface name of the edge node. Entering it incorrectly will cause the flannel and coredns components to malfunction.
    The default value is the specified network interface name entered from the Tencent Cloud page, and specifying --interface will override the original default value.

    Usage example

    # ./edgectl install --node-name node-192.168.67.91 --interface eth0
    NOTE:
    input: [ edgectl install --node-name node-192.168.67.91 --interface eth0 ] ## Input parameters
    logPath: /tmp/tke-edge-install.log ## The log location of this installation
    success-message: Install Edge Node: node-192.168.67.91 Success! ## Message after successful installation
    
    Start Install Edge Node node-192.168.67.91, Please Waiting...
    Waiting Running of the base service
    Dockerd kubelet lite-apiserver has Running! ## Dockerd kubelet lite-apiserver successful installation
    Install Edge Node: node-192.168.67.91 Success! ## Indicates that the edge node installation is successful.
    After the edge node installation is completed, you can execute the command kubectl -n kube-system get pod to check whether all Pods are in the Running state.
    The edgectl install command is valid for one hour and can be used to add different nodes multiple times within the valid period. If it expires, please perform the Script Add Nodes operation again to request a new edgectl.
    If there is no prompt to exit during the installation process, please refer to the installation log location logPath: /tmp/tke-edge-install.log provided in the NOTE for specific errors.
    If there is no "Install Edge Node: node-192.168.67.91 Success!" after execution, the installation is considered failed. Please check the installation log for troubleshooting.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support