Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to resolve hostname using `kubectl logs` or `kubectl exec`

I've created a Kubernetes cluster using CoreOS on AWS and I'm having trouble communicating with nodes from the master.

For example, operations like kubectl exec or kubectl logs fail an error similar to the following:

Error from server: dial tcp: lookup ip-XXX-X-XXX-XXX.eu-west-1.compute.internal: no such host

I've found some issues on Github that describe the problem so I know the team knows about this bug, but I would like to ask here if its possible to use some workaround until it gets addressed somehow.

One workaround mentioned was to use the --hostname-override flag but as I'm on AWS, this flag is ignored (see #22984)

Related issues on GitHub: #22770 #22063.

like image 998
Alex Kalyvitis Avatar asked Apr 15 '16 11:04

Alex Kalyvitis


1 Answers

Have you made sure you're using the right context?

kubectl config use-context my-cluster-name 
like image 183
Allan Schiebold Avatar answered Sep 19 '22 15:09

Allan Schiebold