k8s centos7新增节点
程序员文章站
2022-03-07 11:30:24
...
swapoff -a
sed -i 's/.*swap.*/#&/' /etc/fstab
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
yum install --setopt=obsoletes=0 docker-ce-17.03.2.ce-1.el7.centos.x86_64 docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch -y
yum install kubelet kubeadm kubectl -y
system enable docker
systemctl start docker
system enable kubeadm
systemctl start kubeadm
kubeadm join 192.168.10.197:6443 --token rrt9da.3ozbti9o44ymekng --discovery-token-ca-cert-hash sha256:c8c1876e98314e6409ff694599208366de9d5233c20fd586925364dec890f717
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml