Receiving [apiclient] Failed to create test deployment, dial tcp xxx:6443: getsockopt: connection refused] (will retry) during deployment. 


Check kube-apiserver container status by issuing command

1) docker ps -a 
2) check the status of kube-apiserver, if its in "Exited" status. Yank "CONTAINER ID" of kube-apiserver which is in Exited status.
3) docker logs -f <container_id_kube-apiserver> 

Log Snippet :

"Create /api/v1/namespaces/kube-system/endpoints" [10.000341483s] [10.00027337s] END

E1211 19:00:41.611523       1 reflector.go:201] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70: Failed to list *api.Secret: Get https://localhost:6443/api/v1/secrets?resourceVersion=0: dial tcp x.x.x.x:6443: i/o timeout

E1211 19:00:41.612204       1 reflector.go:201] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70: Failed to list *storage.StorageClass: Get https://localhost:6443/apis/storage.k8s.io/v1beta1/storageclasses?resourceVersion=0: dial tcp x.x.x.x:6443: i/o timeout

E1211 19:00:41.612316       1 reflector.go:201] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70: Failed to list *api.ResourceQuota: Get https://localhost:6443/api/v1/resourcequotas?resourceVersion=0: dial tcp x.x.x.x:6443: i/o timeout

E1211 19:00:41.612420       1 reflector.go:201] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70: Failed to list *api.Namespace: Get https://localhost:6443/api/v1/namespaces?resourceVersion=0: dial tcp x.x.x.x:6443: i/o timeout

E1211 19:00:41.612509       1 reflector.go:201] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70: Failed to list *api.LimitRange: Get https://localhost:6443/api/v1/limitranges?resourceVersion=0: dial tcp x.x.x.x:6443: i/o timeout

E1211 19:00:41.612611       1 reflector.go:201] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:70: Failed to list *api.ServiceAccount: Get https://localhost:6443/api/v1/serviceaccounts?resourceVersion=0: dial tcp x.x.x.x:6443: i/o timeout

E1211 19:00:41.723059       1 client_ca_hook.go:58] Post https://localhost:6443/api/v1/namespaces: dial tcp x.x.x.x:6443: i/o timeout

W1211 19:00:41.723063       1 storage_extensions.go:127] third party resource sync failed: Get https://localhost:6443/apis/extensions/v1beta1/thirdpartyresources: dial tcp x.x.x.x:6443: i/o timeout

F1211 19:00:41.723610       1 controller.go:128] Unable to perform initial IP allocation check: unable to refresh the service IP block: Get https://localhost:6443/api/v1/services: dial tcp x.x.x.x:6443: i/o timeout

Check your /etc/hosts file :

127.0.0.1 localhost
x.x.x.x localhost.xxx.xx

If you notice the x.x.x.x IP address, it does not correlate to anything you might have assigned to the HC instance. Perform a DNS lookup on “localhost.xxx.xx” returns the IP address x.x.x.x .Kubernetes (micro service) inadvertently might be attempting to contact this IP address instead of localhost. Removing the localhost.xxx.xx DNS entry should resolve the issue.