1. 程式人生 > >docker——0開始-《1.0.4k8s的docker工具的使用》

docker——0開始-《1.0.4k8s的docker工具的使用》

k8s部署問題解決

1.如果是安裝的flannel,出現kubectl get nodes 顯示節點 NoReady

第一可能是flannel的網路問題
runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

master/node點:docker pull quay.io/coreos/flannel:v0.10.0-amd64
master:kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml

node點: mkdir -p /etc/cni/net.d/
node點: cat <<EOF> /etc/cni/net.d/10-flannel.conf
{"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=10.224.0.0/16
FLANNEL_SUBNET=10.224.1.0/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
EOF

現在再從master檢視一下吧 kubectl get nodes