How to connect to an headless service in Kubernetes from outside?

Viewed 6847

I created an headless service:

apiVersion: v1
kind: Service
metadata:
  name: myapp-service-headless
spec:
  ports:
    - port: 80
  selector:
    app: myapp
  clusterIP: None

From Kubernetes dashboard I can see its Internal endpoints:

myapp-service-headless:80 TCP
myapp-service-headless:0 TCP

In this application, I also set internal endpoint to:

http://myapp-service-headless

But from outside, how can I access its IP to connect API?

For example, my Kubernetes' IP is 192.168.99.100, then connect to 192.168.99.100 is okay?

Now the service status from Kubernetes dashboard

Services

enter image description here

Service Details

enter image description here

1 Answers
Related