<p>I created an headless service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: myapp-service-headless
spec:
  ports:
    - port: 80
  selector:
    app: myapp
  clusterIP: None
</code></pre>
<p>From Kubernetes dashboard I can see its <code>Internal endpoints</code>:</p>
<pre><code>myapp-service-headless:80 TCP
myapp-service-headless:0 TCP
</code></pre>
<p>In this application, I also set internal endpoint to:</p>
<pre><code>http://myapp-service-headless
</code></pre>
<p>But from outside, how can I access its IP to connect API?</p>
<p>For example, my Kubernetes' IP is <code>192.168.99.100</code>, then connect to <code>192.168.99.100</code> is okay?</p>
<h1>Now the service status from Kubernetes dashboard</h1>
<h2>Services</h2>
<p><a href="https://i.stack.imgur.com/E6BeS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E6BeS.png" alt="enter image description here" /></a></p>
<h2>Service Details</h2>
<p><a href="https://i.stack.imgur.com/6WlBi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6WlBi.png" alt="enter image description here" /></a></p>

online
<p>There is two option to expose the service outside, you can use the ingress controller to connect to the server. </p>

<p>The simple method is change your service type to NodePort, then you should be able access server using NodeIP and service external port number.</p>

<p>here is the more info.</p>

<p><a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" rel="noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport</a></p>
