部署v1.17


yum install kubeadm-1.17.3 kubelet-1.17.3 -y

#kubeadm config images list
images=(
    kube-apiserver:v1.17.17
    kube-controller-manager:v1.17.17
    kube-scheduler:v1.17.17
    kube-proxy:v1.17.17
    pause:3.4.1
    etcd:3.4.3-0
    coredns:1.6.5
)

for imageName in ${images[@]} ; do
    docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/$imageName
    docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$imageName k8s.gcr.io/$imageName
    docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/$imageName
	docker save -o $imageName k8s.gcr.io/$imageName
done

kubeadm config images list

for i in $(ls|grep :);do docker load -i $i;
done


kubeadm init --kubernetes-version=v1.17.17 --pod-network-cidr=10.244.0.0/16  

systemctl enable kubelet
cat /var/lib/kubelet/kubeadm-flags.env |grep cgroup
[root@k8s-1 csiYaml]# cat /var/lib/kubelet/kubeadm-flags.env |grep cgroup
KUBELET_KUBEADM_ARGS="--cgroup-driver=systemd --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.1"
car /etc/docker/daemon.json cgroups与kubelet保持一致

kubectl apply flannel
posted @ 2021-12-08 15:32  nanaindi  阅读(32)  评论(0编辑  收藏  举报