kubeadm reset
cat <<EOF >>/etc/hosts
192.168.16.144 master
192.168.16.145 node2
EOF
kubeadm init --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.16.0 --apiserver-advertise-address 192.168.16.144 --pod-network-cidr=10.244.0.0/16 --token-ttl 0
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export POD_SUBNET=10.244.0.0/16
sed -i "s#192\.168\.0\.0/16#${POD_SUBNET}#" calico-3.9.2.yaml
kubectl apply -f calico-3.9.2.yaml
kubectl apply -f kube-flannel.yml
kubectl get nodes
kubeadm token create --print-join-command
echo 1 > /proc/sys/net/ipv4/ip_forward
kubeadm join 192.168.16.144:6443 --token pkpdza.pnko76ulo74nwsiu --discovery-token-ca-cert-hash sha256:4da1b54426571d9ff8889876c4cc1fbc798d59db464a43fbcf79cb7858ac31c9