kubeadm安装1.18.2问题与解决
2020-05-13 本文已影响0人
掩流年
安装参照文档:
https://v1-18.docs.kubernetes.io/zh/docs/setup/independent/install-kubeadm/
1.swapoff -a 关闭swap
2.kubeadm init使用的国外源,所以下载会超时。
所以需要指定镜像使用阿里云镜像:
kubeadm init --image-repository registry.aliyuncs.com/google_containers
3.安装结束后,master节点为NotReady,需要安装网络插件
docker pull quay.io/coreos/flannel:v0.10.0-amd64
mkdir -p /etc/cni/net.d/
cat <<EOF> /etc/cni/net.d/10-flannel.conf
{"cniVersion":"0.2.0","name":"cbr0","type":"flannel","delegate": {"isDefaultGateway": true}}
EOF
mkdir /usr/share/oci-umount/oci-umount.d -p
mkdir /run/flannel/
cat <<EOF> /run/flannel/subnet.env
FLANNEL_NETWORK=172.100.0.0/16
FLANNEL_SUBNET=172.100.1.0/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
EOF
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml
过程可参照
https://blog.csdn.net/wangmiaoyan/article/details/101216496
error:
1 node(s) had taints that the pod didn't tolerate
master node参与工作负载 (只在主节点执行)
使用kubeadm初始化的集群,出于安全考虑Pod不会被调度到Master Node上,也就是说Master Node不参与工作负载。
允许master进行部署:
kubectl taint nodes --all node-role.kubernetes.io/master-