Networking and DNS in Kubernetes local cluster with Docker

I have downloaded Kubernetes binaries from release tag in Github.
I placed the binaries in my path (i.e. kubectl)

I followed this guide to start up a simple local cluster with Docker containers:
http://kubernetes.io/v1.0/docs/getting-started-guides/docker.html

  • Get log of a systemd/journald in a docker container to “docker logs”
  • How to access tomcat running in docker container from browser?
  • Connecting inside container at docker environment using JSCH
  • How many containers should exist per host in production? How should services be split?
  • Can I start multiple Docker containers based on same image at the same time?
  • Docker tomcat editing configuration files through dockerfile
  • Now I can contact Kubernetes API from 127.0.0.1:8080 and I got Nginx pod running and service exposed.
    I have a ‘docker0’ interface with range 172.17.42.1/16
    Doing ‘docker inspect’ to the containers returns me IP from that range.
    Doing ‘kubectl get services’ returns me IPs from range 10.0.0.0/24
    I can reach Nginx using the IP from 10.0.0.x and 172.16.x.x

    How is the networking set up?
    Why ‘nginx’ service is not showed up in /api/v1/services?

    Also I want to set up monitoring with Heapster+InfluxDB+Grafana.
    Heapster will try to connect to InfluxDB using a hostname that fails to resolve.
    So I searched how to bring up DNS server for Kubernetes.
    I modified a little the files yaml under kubernetes/cluster/addons/dns
    skydns-rc.yaml require the Kubernetes Master IP to make calls to the API to discover services.

    What is the Kubernetes Master IP?
    From the docker host Kubernetes Master IP is 127.0.0.1 but it is not reachable from inside the pods (afaik 127.0.0.1 inside the pods is the pod itself)
    It isnt 10.0.0.1 because its not working from the docker host neither from the kube2sky container.

    I cant find any help in the documentation or Github as it is very focused for cloud and GCE.

    Thanks for your help!

  • How to set up Docker development environment on Debian?
  • libGL error: failed to load driver swrast in docker container
  • Docker/Boot2Docker: Set HTTP/HTTPS proxies for docker on OS X
  • Why doesn't the container start?
  • Jenkins pipeline docker.image call generates a timeout
  • This site can't be reached docs/docker.github.io
  • One Solution collect form web for “Networking and DNS in Kubernetes local cluster with Docker”

    The DNS pod can use the KUBERNETES_SERVICE_HOST environment variable or the IP of the machine you’re really on (rather than 127.0.0.1) if you don’t have service accounts configured (probably don’t)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.