curl -s https://gitee.com/hewei8520/File/raw/master/1.13.5/lvm.sh |bash mkdir -p /data/kubelet ln -s /data/kubelet /var/lib/kubelet systemctl stop docker mv /var/lib/docker /data/ ln -s /data/docker /var/lib/docker systemctl restart docker # 除了将masterIP解析到hosts还包括本机地址何VIP地址 curl -s https://gitee.com/hewei8520/File/raw/master/1.13.5/base-env-config-multi-node.sh |bash # 可选参数 --experimental-control-plane 新增master节点 kubeadm join 172.16.100.254:6443 --token abcdef.0123456789abcdef --discovery-token-ca-cert-hash sha256:6db027f8c7f8aaa23e1dac2c0f4a274d9364a3e253c3e762aed563ca3ae90dfb systemctl stop kubelet systemctl stop docker sed -i ‘s/var\/lib/data/g‘ /lib/systemd/system/kubelet.service.d/10-kubeadm.conf sed -i ‘s/Environment="KUBELET_KUBECONFIG_ARGS=/Environment="KUBELET_KUBECONFIG_ARGS=--root-dir=\/data\/kubelet /g‘ /lib/systemd/system/kubelet.service.d/10-kubeadm.conf systemctl enable --now docker systemctl enable --now kubeletkubeadm join 172.16.100.254:6443 --token abcdef.0123456789abcdef --discovery-token-ca-cert-hash sha256:6db027f8c7f8aaa23e1dac2c0f4a274d9364a3e253c3e762aed563ca3ae90dfb 或kubeadm join apiserver01.1ziton.com:6443 --token abcdef.0123456789abcdef --discovery-token-ca-cert-hash sha256:6db027f8c7f8aaa23e1dac2c0f4a274d9364a3e253c3e762aed563ca3ae90dfb如果新机器是裸机,需要提前执行该命令curl -s https://gitee.com/hewei8520/File/raw/master/1.13.5/systemd.sh |bash
原文地址:https://www.cnblogs.com/heweiblog/p/10844995.html
时间: 2024-11-05 23:30:39