Bootstrap

kubekey添加节点

yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
systemctl stop firewalld
systemctl disable firewalld
timedatectl set-timezone Asia/Shanghai
sed -i ‘s/enforcing/disabled/’ /etc/selinux/config
setenforce 0
swapoff -a
hostnamectl set-hostname node6
hostname
echo “modprobe br_netfilter” >> /etc/profile

cat >/etc/sysctl.d/k8s.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
sysctl -p /etc/sysctl.d/k8s.conf

cat </etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
yum repolist

cat </etc/sysconfig/modules/ipvs.modules
#!/bin/bash
ipvs_modules=“ip_vs ip_vs_lc ip_vs_wlc ip_vs_rr ip_vs_wrr ip_vs_lblc ip_vs_lblcr ip_vs_dh ip_vs_sh ip_vs_nq ip_vs_sed ip_vs_ftp nf_conntrack”
for kernel_module in ${ipvs_modules}; do
/sbin/modinfo -F filename ${kernel_module} > /dev/null 2>&1
if [ 0 -eq 0 ]; then
/sbin/modprobe ${kernel_module}
fi
done
EOF
chmod 755 /etc/sysconfig/modules/ipvs.modules && bash /etc/sysconfig/modules/ipvs.modules && lsmod | grep ip_vs

yum -y install ipvsadm conntrack chrony telnet vim
yum install docker-ce-20.10.10 docker-ce-cli-20.10.10 containerd.io -y
systemctl start docker && systemctl enable docker && systemctl status docker

echo </etc/docker/daemon.json
{
“log-opts”: {
“max-size”: “5m”,
“max-file”:“3”
},
“registry-mirrors”: [“https://docker.mirrors.ustc.edu.cn”],
“insecure-registries”: [“harbor.usharingtech.com:18443”],
“exec-opts”: [“native.cgroupdriver=systemd”]
}
EOF
systemctl daemon-reload
systemctl restart docker

;