<p>I'm running Kong API gateway on GKE and trying to add my own service. </p>

<p>I have 3 pods</p>

<ul>
<li><code>cassandra</code></li>
<li><code>kong</code> </li>
<li><code>apiindex</code></li>
</ul>

<p>and  2 services(node ports) </p>

<ul>
<li><code>apiindex</code> (80/443/8080 ports are open)</li>
<li><code>kong-proxy</code>(8000/8001/8443)</li>
</ul>

<p>I'm trying to add <code>apiindex</code> api to API gateway using</p>

<blockquote>
  <p>curl -i -X POST <a href="http://kong-proxy:8001/apis" rel="nofollow noreferrer">http://kong-proxy:8001/apis</a> -d 'name=test' -d 'uris=/'
  -d 'upstream_url=<a href="http://apiindex/" rel="nofollow noreferrer">http://apiindex/</a>'</p>
</blockquote>

<p>But then <code>http://kong-proxy:8000/</code> returns </p>

<blockquote>
  <p>503 {"message": "Service unavailable"}</p>
</blockquote>

<p>It works fine when I add some public website inside 
<code>curl -i -X POST http://kong-proxy:8001/apis -d 'name=test' -d 'uris=/' -d 'upstream_url=http://httpbin.org/'</code></p>

<p><code>curl http://apiindex/</code> returns 200 from <code>kong</code> pod. </p>

<p>Is it possible to add API using kong without exposing <code>apiindex</code> service? </p>

<p>You need to use the fully qualified name of the service (FQDN) in kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/</a></p>

<p>So instead of <code>apiindex</code> need to use <code>apiindex.default.svc.cluster.local</code></p>

<blockquote>
  <p>curl -i -X POST <a href="http://kong-proxy:8001/apis" rel="nofollow noreferrer">http://kong-proxy:8001/apis</a> -d 'name=testapi' -d
  'uris=/' -d 'upstream_url=<a href="http://apiindex.default.svc.cluster.local/" rel="nofollow noreferrer">http://apiindex.default.svc.cluster.local/</a>'</p>
</blockquote>
