Worker Node Installation

Repeat the steps from Step 1 to Step 4. Then execute the following:

  1. Use the token generated from the Master Node:
      Eg:  kubeadm join :6443 --token --discovery-token-ca-cert-hash sha256: 
  2. Fix the flannel on worker node:
    cat <<'EOF' | sudo tee /usr/local/bin/flannel-dns-fix.sh
    #!/bin/bash
    if [ ! -d /sys/class/net/flannel.1 ]; then
    logger "flannel-dns-fix: flannel.1 not found, will retry later"
    exit 1
    fi
    /usr/sbin/ethtool -K flannel.1 tx off 2>/dev/null || true
    logger "flannel-dns-fix: Disabled TX checksum offload on flannel.1"
    PHYS_INT=$(ip route | grep default | awk '{print $5}')
    if [ -n "$PHYS_INT" ]; then
    /usr/sbin/ethtool -K $PHYS_INT tx off 2>/dev/null || true
    fi
    touch /var/run/flannel-dns-fix.done
    EOF
    sudo chmod +x /usr/local/bin/flannel-dns-fix.sh
    cat <<'EOF' | sudo tee /etc/systemd/system/flannel-dns-fix.service
    [Unit]
    Description=Fix Flannel VXLAN TX Checksum Offload for DNS
    After=network.target
    ConditionPathExists=!/var/run/flannel-dns-fix.done
    [Service]
    Type=oneshot
    ExecStart=/usr/local/bin/flannel-dns-fix.sh
    RemainAfterExit=no
    EOF
    cat <<'EOF' | sudo tee /etc/systemd/system/flannel-dns-fix.timer
    [Unit]
    Description=Timer for Flannel DNS Fix
    [Timer]
    OnBootSec=30
    OnUnitActiveSec=10
    AccuracySec=1
    [Install]
    WantedBy=timers.target
    EOF
    sudo systemctl daemon-reload
    sudo systemctl enable flannel-dns-fix.timer
    sudo systemctl start flannel-dns-fix.timer
    sudo systemctl start flannel-dns-fix.service
    echo ""
    ethtool -k flannel.1 | grep tx-checksum
  3. Verification (From Master), we should be able to see the newly added worker node by executing the 1st command:
    kubectl get nodes
    kubectl get pods -n kube-flannel -o wide