k8s 安装flannel网络插件
Master Node01节点 同样安装步骤
mkdir -p /etc/cni/net.d/
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.244.0.0/16
FLANNEL_SUBNET=10.244.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
//查看kubernetes-dashboard create -f xxx.yaml 拉取失败的原因:ErrImagePull、ImagePullBackOff
命令:
kubectl describe pod kubernetes-dashboard-669f9bbd46-dph47
命令:
kubectl describe pod kubernetes-dashboard-669f9bbd46-dph47
kubectl 常用命令:
kubectl get pods --all-namespaces //查看kube-flannel 状态 running 为安装正常
kubectl get pods --all-namespaces -o wide
kubectl get nodes
kubectl get cs
kubectl get csr
kubectl apply -f xxxx.yaml
kubectl create -f xxxx.yaml
kubectl delete -f xxxxx.yaml
kubectl reset //重置整个k8s集群,master node节点相同操作
查看dashboard 外网映射端口:
kubectl get svc kubernetes-dashboard -n kube-system