CrashLoopBackOff、Reason: Get https://10.96.0.1:443/version: dial tcp 10.96.0.1:443: i/o timeout

created at 12-11-2021 views: 21

solution

view logs

  1. Logs view the specific error reason, and found that the reason is dial tcp 10.96.0.1:443: i/o timeout
  2. I see that the reason is that the working node of dashboard cannot connect to API Server and the pod of master's api server works normally

reason

① My problem is that when using kubeadm to initialize the cluster, pod-network-cidr is not specified. In this case, it is not ensured that the IP of the host/main network is in the referenced subnet.

That is, if your network is running at 192.168.., use 10.0.0.0/16. If your network is 10.0.., use 192.168.0.0/16.

In other words, when using the kubeadm init command to initialize the master node, when assigning the CIDR network segment to the network plug-in, the ip address in your environment (master node and working node) cannot coincide with the network plug-in network segment! (As stated on the official website)

solution

  1. Reset the created k8s cluster (master, node)
  2. Initialize the cluster master, specify the CIDR of the pod network, and join the node node
  3. The master downloads kubernetes-dashboard.yaml and deploys access
# kubeadm reset
# kubeadm init --apiserver-advertise-address 192.168.52.100  --pod-network-cidr=10.244.0.0/16
# 192.168.52.100是master的IP
# …………
created at:12-11-2021
edited at: 12-11-2021: