Skip to content
Advertisement

Can’t resolve monitoring-influxdb on Kubernetes with heapster and kube-dns

I am trying to get Heapster working on my Kubernetes cluster. I am using Kube-DNS for DNS resolution.

My Kube-DNS seems to be set up correctly:

kubectl describe pod kube-dns-v20-z2dd2 -n kube-system

JavaScript

kubectl describe svc kube-dns -n kube-system

JavaScript

kubectl describe ep kube-dns -n kube-system

JavaScript

kubectl exec -it busybox1 — nslookup kubernetes.default

JavaScript

However if I am trying to resolve http://monitoring-influxdb on either the busybox container (outside the kube-system namespace) it can’t get resolved:

kubectl exec -it heapster-v1.2.0-7657f45c77-65w7w –container heapster -n kube-system — nslookup http://monitoring-influxdb

JavaScript

kubectl exec -it heapster-v1.2.0-7657f45c77-65w7w –container heapster -n kube-system — cat /etc/resolv.conf

JavaScript

kubectl exec -it busybox1 — nslookup http://monitoring-influxdb

JavaScript

kubectl exec -it busybox1 — cat /etc/resolv.conf

JavaScript

Finally here are the logs from the heapster pod. I could not find any error in the dns pod logs:

kubectl logs heapster-v1.2.0-7657f45c77-65w7w heapster -n kube-system

JavaScript

Any pointers are highly appreciated.

EDIT:

The monitoring-influxdb is located in the same namespace as the heapster (kube-system).

kubectl exec -it heapster-v1.2.0-7657f45c77-65w7w –container heapster -n kube-system — nslookup monitoring-influxdb.kube-system

JavaScript

But for whatever reason busybox is able to resolve the server.

kubectl exec -it busybox1 — nslookup http://monitoring-influxdb.kube-system

JavaScript

kubectl -n kube-system get svc

JavaScript

kubectl -n kube-system get ep

JavaScript

Advertisement

Answer

In kubernetes, you can resolve services by their name alone, but only if you are inside the same namespace.

Services are also reachable through a DNS name in the form:

JavaScript

From your question is not clear in which namespace you deployed influxdb, but give the above suggestion a try.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement