AKS icon indicating copy to clipboard operation
AKS copied to clipboard

kubectl get fails with error Unable to connect to the server: dial tcp: look up ....no such host

Open grohan2002 opened this issue 8 years ago • 14 comments

Issue AZCLI used - 2.0.25 Created an AKS setup used the Jenkins Microsoft Template workstation . Commands used ==> az group create --name simplimedaks-new-rg --location eastus ==> az aks create --resource-group simplimedaks-new-rg --name simplimedaks-new --node-count 2 --generate-ssh-keys --kubernetes-version 1.8.1 ==> sudo az aks install-cli ==> az aks get-credentials --resource-group=simplimedaks-new-rg --name=simplimedaks-new ==> kubectl get node -o wide

error Unable to connect to the server: dial tcp: lookup simplimeda-simplimedaks-new-4ad96d-c2b29752.hcp.eastus.azmk8s.io on 168.63.129.16:53: no such host

grohan2002 avatar Jan 19 '18 08:01 grohan2002

me too

p8n-labs avatar Jan 19 '18 08:01 p8n-labs

Same with westeurope,

Unable to connect to the server: net/http: TLS handshake timeout

mdaguete avatar Jan 19 '18 08:01 mdaguete

Dupe of #139 and #137. This has been happening on and off since at least the morning of 2018-01-18. My understanding from MS as of yesterday afternoon is that centralus is back to normal, but eastus is still broken. The connection issue appeared to be resolved yesterday, but another issue remained: new clusters were broken.

Newly created clusters look like this:

kubectl get pods --all-namespaces:

NAMESPACE     NAME                                    READY     STATUS             RESTARTS   AGE
kube-system   heapster-58f795c4cf-6rlnf               2/2       Running            0          24m
kube-system   kube-dns-v20-6c8f7f988b-ps66h           3/3       Running            0          24m
kube-system   kube-dns-v20-6c8f7f988b-q7krk           3/3       Running            0          24m
kube-system   kube-proxy-5mddr                        1/1       Running            0          24m
kube-system   kube-proxy-d5dgc                        1/1       Running            0          24m
kube-system   kube-proxy-g7nqr                        1/1       Running            0          24m
kube-system   kube-proxy-jq4gl                        1/1       Running            0          24m
kube-system   kube-proxy-k522r                        1/1       Running            0          24m
kube-system   kube-proxy-lh6ml                        1/1       Running            0          24m
kube-system   kube-proxy-mvsbj                        1/1       Running            0          24m
kube-system   kube-proxy-njdk4                        1/1       Running            0          24m
kube-system   kube-proxy-x6j9c                        1/1       Running            0          24m
kube-system   kube-svc-redirect-4nd6v                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-6j4zt                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-8xxpw                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-b2dgw                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-d9jph                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-svmpm                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-tlbhr                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-tzcqt                 0/1       CrashLoopBackOff   9          24m
kube-system   kube-svc-redirect-zcl74                 0/1       CrashLoopBackOff   9          24m
kube-system   kubernetes-dashboard-6fc8cf9586-6dmmd   0/1       CrashLoopBackOff   8          24m
kube-system   tunnelfront-694df5ff5d-7lx6r            1/1       Running            0          24m

To add insult to injury, MS's status page is lying about AKS being green in eastus so I have to keep building clusters just to see if it's fixed yet.

larslevie avatar Jan 19 '18 11:01 larslevie

Have you tried creating the cluster with version 1.8.6?

seneccamiller avatar Jan 19 '18 19:01 seneccamiller

@seneccamiller Tried with 1.8.6 ,

was able to connect using kubectl but still we are facing intermittent connection issues

vagrant@node2 ~$ kubectl get nodes -o wide The connection to the server simplimeda-simplimedaks-new-4ad96d-693e3b50.hcp.eastus.azmk8s.io:443 was refused - did you specify the right host or port? vagrant@node2 ~$ kubectl get nodes -o wide The connection to the server simplimeda-simplimedaks-new-4ad96d-693e3b50.hcp.eastus.azmk8s.io:443 was refused - did you specify the right host or port? vagrant@node2 ~$ kubectl get nodes -o wide The connection to the server simplimeda-simplimedaks-new-4ad96d-693e3b50.hcp.eastus.azmk8s.io:443 was refused - did you specify the right host or port? vagrant@node2 ~$ kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME aks-nodepool1-33828484-0 NotReady agent 14m v1.8.6 Debian GNU/Linux 8 (jessie) 4.11.0-1016-azure docker://1.12.6 aks-nodepool1-33828484-1 Ready agent 13m v1.8.6 Debian GNU/Linux 8 (jessie) 4.11.0-1016-azure docker://1.12.6 vagrant@node2 ~$ kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME aks-nodepool1-33828484-0 NotReady agent 15m v1.8.6 Debian GNU/Linux 8 (jessie) 4.11.0-1016-azure docker://1.12.6 aks-nodepool1-33828484-1 Ready agent 14m v1.8.6 Debian GNU/Linux 8 (jessie) 4.11.0-1016-azure docker://1.12.6

Moreover , one of the nodes in the setup gives the same error as mentioned in the issue ;-

Warning KubeletSetupFailed 13m kubelet, aks-nodepool1-33828484-0 Kubelet failed to get node info: failed to get external ID from cloud provider: Get http://169.254.169.254/metadata/instance/compute/name?api-version=2017-04-02&format=text: dial tcp 169.254.169.254:80: getsockopt: no route to host

rohangupt avatar Jan 20 '18 05:01 rohangupt

Closing due inactivity. Feel free to re-open if still an issue.

seanknox avatar Aug 02 '18 19:08 seanknox

this happens constantly to me on newly created AKS cluster

andrei-dascalu avatar Oct 31 '19 14:10 andrei-dascalu

This is happening on AWS as well with kops created clusters.

bhvishal9 avatar Mar 04 '20 12:03 bhvishal9

same issue here, I have just deployed a new cluster in US West 2, but can't connect to apiserver due to the DNS resolve issue:

The behavior of this command has been altered by the following extension: aks-preview
Merged "q1win" as current context in /home/ylhyh/.kube/config
ylhyh@Azure:~$ kubectl get nodes
Unable to connect to the server: dial tcp: lookup q1win-dns-27def107.c61914bc-dfd4-4cb1-9582-947bd9976708.privatelink.westus2.azmk8s.io on 168.63.129.16:53: no such host```

ylhyh avatar Apr 13 '20 03:04 ylhyh

I have a workaround to bypass this issue: disable "Private cluster" feature when creating kubernetes cluster

ylhyh avatar Apr 13 '20 05:04 ylhyh

I'm also having this issue. Followed these steps https://docs.microsoft.com/en-us/azure/aks/azure-ad-integration exactly and can't connect.

PhelixPhoenix avatar Apr 20 '20 22:04 PhelixPhoenix

Hi was getting this today. I have the aks-preview extension as part of my az CLI. It was out of date. I upgraded it and everything is working again.

gminnella23 avatar May 12 '20 19:05 gminnella23

hello you forgot this command az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

raouf-massy avatar Jun 24 '20 22:06 raouf-massy

hello you forgot this command az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

Yes. This solves the issue. Make sure also that you set the subscription if you have multiple.

eman32387 avatar Jul 09 '20 09:07 eman32387