title: How do I make an external REST API (running in .Net on my host computer) accessible within K8s from a Service or ExternalName?
body: <p>I have a REST API running locally on my laptop at <code>https://localhost:5001/something</code>. I want that to be reachable <em>inside</em> the Kubernetes cluster from a K8s DNS name. For example, an application running inside a Pod could use <code>some-service</code> instead of needing the entire Url.</p>
  <p>Also, since <code>localhost</code> is relative to the host machine, how would I get the <code>Service</code> or <code>ExternalName</code> to reach <code>localhost</code> on the host machine, instead of inside the K8s cluster?</p>
  <p>I tried <code>docker.host.internal</code> (as suggested <a href="https://stackoverflow.com/a/65942540">here</a>) but that didn't work.
  And <a href="https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors" rel="nofollow noreferrer">this from K8s documentation</a> says that it can't be the loopback:</p>
  <blockquote>
  <p>The endpoint IPs must not be: loopback (127.0.0.0/8 for IPv4, ::1/128 for IPv6), or link-local (169.254.0.0/16 and 224.0.0.0/24 for IPv4, fe80::/64 for IPv6).</p>
  </blockquote>
  <p>I'm running:</p>
  <ul>
  <li><strong>Host Machine:</strong> Ubuntu 20.04</li>
  <li><strong>K8s:</strong> k3d</li>
  <li><strong>Web API:</strong> (.Net Core 3.1 on Linux, created by <code>dotnet new webapi MyAPI</code>)</li>
  </ul>