K3s offline deployment

  1. Download offline image package
    Offline image package download address

    Because my environment is CentOS 7.7, so download the two in the red box
    insert image description here
    Download Deployment Script
    Deployment Script Download Address (https://get.k3s.io)

  2. After uploading the prepared file to the server, put the k3s binary file and image package into the specified directory (executed on each node)

    $ mkdir -p /var/lib/rancher/k3s/agent/images/
    $ cp ./k3s-airgap-images-amd64.tar /var/lib/rancher/k3s/agent/images/
    
    $ chmod +x k3s
    $ cp ./k3s /usr/local/bin/
    
  3. Install k3s on the control node

    $ chmod +x install.sh
    $ INSTALL_K3S_SKIP_DOWNLOAD=true ./install.sh
    

    insert image description here

  4. Add a node to the cluster
    to get node-token

    $ cat /var/lib/rancher/k3s/server/node-token
    

    Assign the token in the previous step to the node-token
    master-ip in the command below and replace it with the IP of the control node

    $ INSTALL_K3S_SKIP_DOWNLOAD=true K3S_URL=https://{
          
          master-ip}:6443    K3S_TOKEN=${node-token} ./install.sh
    

    insert image description here

  5. View the final deployment result
    insert image description here

Guess you like

Origin blog.csdn.net/weixin_45804031/article/details/127876808