yum install -y nfs-utils docker
sed -i 's/--selinux-enabled --log-driver=journald --signature-verification=false/--selinux-enabled=false --graph \/docker --insecure-registry dockerhub.daline.com.cn:5000/' /etc/sysconfig/docker
systemctl disable --now firewalld
systemctl enable --now docker

cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
EOF
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
yum install -y kubelet-1.21.2 kubeadm-1.21.2 kubectl-1.21.2 --disableexcludes=kubernetes

docker pull dockerhub.daline.com.cn:5000/k8s.gcr.io/kube-proxy:v1.21.2
docker pull dockerhub.daline.com.cn:5000/k8s.gcr.io/pause:3.4.1
docker tag dockerhub.daline.com.cn:5000/k8s.gcr.io/kube-proxy:v1.21.2 k8s.gcr.io/kube-proxy:v1.21.2
docker tag dockerhub.daline.com.cn:5000/k8s.gcr.io/pause:3.4.1 k8s.gcr.io/pause:3.4.1
docker rmi dockerhub.daline.com.cn:5000/k8s.gcr.io/kube-proxy:v1.21.2
docker rmi dockerhub.daline.com.cn:5000/k8s.gcr.io/pause:3.4.1