<p dir="auto">I tried following the official docker based local cluster setup guide <a href="http://kubernetes.io/docs/getting-started-guides/docker/#prerequisites" rel="nofollow">here</a> on OSX and it fails to work in the case of v1.2.</p>
<p dir="auto">There are several issues. Enumerating a few of them.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> API server is not accessible from outside of the docker VM host.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Image garbage collection fails</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Problem with nsinit - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="123685826" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/19069" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/19069/hovercard" href="https://github.com/kubernetes/kubernetes/pull/19069">#19069</a> might solve this.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Volumes cleanup - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="140423920" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/22911" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/22911/hovercard" href="https://github.com/kubernetes/kubernetes/issues/22911">#22911</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Master node setup is racy - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="141925925" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/23197" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/23197/hovercard" href="https://github.com/kubernetes/kubernetes/issues/23197">#23197</a></li>
</ul>
<p dir="auto">Some of the issues above are common to other linux based platforms too. This issue will serve as an umbrella issue for getting hyperkube functional soon.</p>
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.): No</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="117485967" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/17406" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/17406/hovercard" href="https://github.com/kubernetes/kubernetes/issues/17406">#17406</a> is the only one I found that might be related, I think this is a feature request to implement the dnsPolicy support.</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):</p>

<p dir="auto">BUG REPORT</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p>
<p dir="auto">Kubernetes version: 1.3.6</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@c910f04x19k07:~# kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;3&quot;, GitVersion:&quot;v1.3.6&quot;, GitCommit:&quot;ae4550cc9c89a593bcda6678df201db1b208133b&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-08-26T18:13:23Z&quot;, GoVersion:&quot;go1.6.2&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;3+&quot;, GitVersion:&quot;cfc-0.1.0-dirty&quot;, GitCommit:&quot;7577a50e5c71505e3458884f83590270bb693351&quot;, GitTreeState:&quot;dirty&quot;, BuildDate:&quot;2016-10-25T17:24:22Z&quot;, GoVersion:&quot;go1.6.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
root@c910f04x19k07:~# "><pre class="notranslate"><code class="notranslate">root@c910f04x19k07:~# kubectl version
Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.6", GitCommit:"ae4550cc9c89a593bcda6678df201db1b208133b", GitTreeState:"clean", BuildDate:"2016-08-26T18:13:23Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"3+", GitVersion:"cfc-0.1.0-dirty", GitCommit:"7577a50e5c71505e3458884f83590270bb693351", GitTreeState:"dirty", BuildDate:"2016-10-25T17:24:22Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
root@c910f04x19k07:~# 
</code></pre></div>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: hardware configuration</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): Ubuntu 16.04</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): Linux c910f04x19k07 4.4.0-45-generic <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35537132" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/66" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/66/hovercard" href="https://github.com/kubernetes/kubernetes/issues/66">#66</a>-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux</li>
<li><strong>Install tools</strong>: Run kubernetes in containers</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">For some service discovery issue with the software I am running, I have to run some PODs with hostNetwork=true, however, I still need to have the POD access the other PODs through Kubernetes service, but it turned out that the dnsPolicy=ClusterFirst does not help, the POD uses the /etc/resolv.conf from the docker host and could not resolve the Kubernete service hostnames.</p>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">With  hostNetwork=true and dnsPolicy=ClusterFirst,  the POD should use the kube-dns to resolve the hostnames in Kubernetes cluster.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<p dir="auto">1 create the yaml file</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@c910f04x19k07:~/yaml# cat nginx.yaml 
apiVersion: v1
kind: Service
metadata:
  name: my-nginx
  labels:
    app: my-nginx
spec:
  type: LoadBalancer
  ports:
  - port: 8800
    targetPort: 80
  selector:
    app: my-nginx

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my-nginx
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: my-nginx
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirst
      containers:
      - name: my-nginx
        image: nginx:1.8.1
        ports:
        - containerPort: 31556
root@c910f04x19k07:~/yaml# "><pre class="notranslate"><code class="notranslate">root@c910f04x19k07:~/yaml# cat nginx.yaml 
apiVersion: v1
kind: Service
metadata:
  name: my-nginx
  labels:
    app: my-nginx
spec:
  type: LoadBalancer
  ports:
  - port: 8800
    targetPort: 80
  selector:
    app: my-nginx

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my-nginx
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: my-nginx
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirst
      containers:
      - name: my-nginx
        image: nginx:1.8.1
        ports:
        - containerPort: 31556
root@c910f04x19k07:~/yaml# 
</code></pre></div>
<p dir="auto">2 create the deployment and service</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@c910f04x19k07:~/yaml# kubectl create -f nginx.yaml 
service &quot;my-nginx&quot; created
deployment &quot;my-nginx&quot; created
root@c910f04x19k07:~/yaml#"><pre class="notranslate"><code class="notranslate">root@c910f04x19k07:~/yaml# kubectl create -f nginx.yaml 
service "my-nginx" created
deployment "my-nginx" created
root@c910f04x19k07:~/yaml#
</code></pre></div>
<p dir="auto">3 Make sure the service and POD are up and running</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@c910f04x19k07:~/yaml# kubectl get service | grep my-nginx
my-nginx         20.0.0.66    &lt;pending&gt;     8800/TCP          31s
root@c910f04x19k07:~/yaml#"><pre class="notranslate"><code class="notranslate">root@c910f04x19k07:~/yaml# kubectl get service | grep my-nginx
my-nginx         20.0.0.66    &lt;pending&gt;     8800/TCP          31s
root@c910f04x19k07:~/yaml#
</code></pre></div>
<p dir="auto">4 kubectl exec into the POD and try to access the Kubernete service nodename:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@c910f04x19k07:~/yaml# kubectl get pod | grep nginx
my-nginx-103987416-1r8z6        1/1       Running   0          40s
root@c910f04x19k07:~/yaml#
root@c910f04x19k07:~/yaml# kubectl exec -it my-nginx-103987416-1r8z6 -- /bin/bash
root@c910f04x19k09:/# cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.2.1.2
search pok.stglabs.ibm.com
root@c910f04x19k09:/# ping my-nginx
ping: unknown host"><pre class="notranslate"><code class="notranslate">root@c910f04x19k07:~/yaml# kubectl get pod | grep nginx
my-nginx-103987416-1r8z6        1/1       Running   0          40s
root@c910f04x19k07:~/yaml#
root@c910f04x19k07:~/yaml# kubectl exec -it my-nginx-103987416-1r8z6 -- /bin/bash
root@c910f04x19k09:/# cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.2.1.2
search pok.stglabs.ibm.com
root@c910f04x19k09:/# ping my-nginx
ping: unknown host
</code></pre></div>
<p dir="auto">5 Update the /etc/resolv.conf with the Kubernetes DNS and ping the service name again</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@c910f04x19k09:/#echo &quot;search default.svc.cluster.local svc.cluster.local cluster.local pok.stglabs.ibm.com
nameserver 20.0.0.10
options ndots:5&quot; &gt; /etc/resolv.conf
root@c910f04x19k09:/#ping my-nginx
PING my-nginx.default.svc.cluster.local (20.0.0.66): 56 data bytes
^C--- my-nginx.default.svc.cluster.local ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
root@c910f04x19k09:/#
"><pre class="notranslate"><code class="notranslate">root@c910f04x19k09:/#echo "search default.svc.cluster.local svc.cluster.local cluster.local pok.stglabs.ibm.com
nameserver 20.0.0.10
options ndots:5" &gt; /etc/resolv.conf
root@c910f04x19k09:/#ping my-nginx
PING my-nginx.default.svc.cluster.local (20.0.0.66): 56 data bytes
^C--- my-nginx.default.svc.cluster.local ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
root@c910f04x19k09:/#

</code></pre></div>
<p dir="auto"><strong>Anything else do we need to know</strong>:</p>