<p>I can't find a way to make an nginx pod resolve another kubernetes services URLs.</p>

<p><strong>I am NOT using kube-dns</strong> , we are using kube2sky solely and we are not going to implement kube-dns yet, so I need to fix in this scenario.</p>

<p>For example, I want nginx to resolve a service URL <code>app.mynamespace.svc.skydns.local</code> but if I run a ping to that URL it resolves successfully.</p>

<p>My nginx config part is:</p>

<pre><code>location /api/v1/namespaces/mynamespace/services/app/proxy/ {
          resolver 127.0.0.1
          set \$endpoint \"http://app.mynamespace.svc.skydns.local/\";
          proxy_pass \$endpoint;
          proxy_http_version 1.1;
          proxy_set_header Connection \"upgrade\";
        }
</code></pre>

<p>I need to specify the target upstream in a variable because I want nginx to starts even if the target is not available, if I don't specify in variable nginx crashes when starting up because the upstream needs to be available and resolvable.</p>

<p>The problem I think is the resolver value, I've tried with <code>127.0.0.1</code>, with <code>127.0.0.11</code>, and with the skydns IP specified in configuration <code>172.40.0.2:53</code>:</p>

<pre><code>etcdctl get /skydns/config
{"dns_addr":"0.0.0.0:53","ttl":4294967290,"nameservers":["172.40.0.2:53"]}
</code></pre>

<p>But nginx cannot resolve the URL yet.</p>

<p>What IP should I specify in the resolver field in nginx config for kubernetes and skydns config?</p>

<p>Remember that we don't have kube-dns.</p>

<p>Thank you.</p>

Claudio Saavedra
<p>I don't think resolving <code>app.mynamespace.svc.skydns.local</code> has anything to do with configuring the upstream DNS servers. Generally, for that, you configure a well-known DNS server like <code>8.8.8.8</code> or your cloud infrastructure DNS server which would be perhaps <code>172.40.0.2</code>. For example as described in the <a href="https://github.com/skynetservices/skydns" rel="nofollow noreferrer">docs</a>:</p>

<pre><code>$ curl -XPUT http://127.0.0.1:4001/v2/keys/skydns/config \
-d value='{"dns_addr":"127.0.0.1:5354","ttl":3600, "nameservers": ["8.8.8.8:53","8.8.4.4:53"]}'
</code></pre>

<p>You might want to check the logs of your <code>kube2sky2</code> pod, for any guidance and that all the <a href="https://github.com/gravitational/kube2sky" rel="nofollow noreferrer">config options</a> are specified like <code>--kube-master-url</code>, <code>--etcd-server</code>. Maybe it can't talk to the Kubernetes master and receive updates of running pods so that the SRV entries get updates.</p>
