Kubernetes cluster setup fails

7/8/2020

I did kubernetes cluster set up by following these steps

Getting below error

error execution phase preflight: couldn't validate the identity of the API Server: Get https://master_ip:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s: context deadline exceeded (Client.Timeout exceeded while awaiting headers)




join.go:441] [preflight] Discovering cluster-info
I0708 11:21:00.558484   26181 token.go:188] [discovery] Trying to connect to API Server "ip_address:6443"
I0708 11:21:00.559011   26181 token.go:73] [discovery] Created cluster-info discovery client, requesting info from "https://ipaddress:6443"
I0708 11:21:00.559138   26181 round_trippers.go:423] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubeadm/v1.17.8 (linux/amd64) kubernetes/35dc4cd" 'https://ip_address:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s'
I0708 11:21:10.559339   26181 round_trippers.go:443] GET https://ip_address:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s  in 10000 milliseconds
I0708 11:21:10.559376   26181 round_trippers.go:449] Response Headers:
I0708 11:21:10.559439   26181 token.go:78] [discovery] Failed to request cluster info: [Get https://ip_address:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)]
I0708 11:21:10.559455   26181 token.go:191] [discovery] Failed to connect to API Server "ip_address:6443": Get https://ip_address:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I0708 11:21:15.559694   26181 token.go:188] [discovery] Trying to connect to API Server "ip_address:6443"
I0708 11:21:15.560266   26181 token.go:73] [discovery] Created cluster-info discovery client, requesting info from "https://ip_address:6443"
I0708 11:21:15.560381   26181 round_trippers.go:423] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubeadm/v1.17.8 (linux/amd64) kubernetes/35dc4cd" 'https://ip_address:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s'
I0708 11:21:25.560573   26181 round_trippers.go:443] GET https://ip_address:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s  in 10000 milliseconds
-- user11708158
kubernetes

1 Answer

7/8/2020

This could be because of below reasons

  1. Node VM's timezone is different
  2. Tokens include the offending n character
  3. Firewall blocking traffic from worker to master node.

Run kubeadm join with e.g -v=9 to show more details.

-- Arghya Sadhu
Source: StackOverflow