Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to discover headless service endpoints

Is there a way to discover all the endpoints of a headless service from outside the cluster?

Preferably using DNS or Static IPs

like image 842
shaylevi2 Avatar asked Nov 15 '15 13:11

shaylevi2


People also ask

How do I access headless service outside cluster?

There is two option to expose the service outside, you can use the ingress controller to connect to the server. The simple method is change your service type to NodePort, then you should be able access server using NodeIP and service external port number. here is the more info.

How do I call headless service?

We create a headless service which is used for creating a service grouping. That does not allocate an IP address or forward traffic.So you can do this by explicitly setting ClusterIP to “None” in the mainfest file, which means no cluster IP is allocated. For example, if you host MongoDB on a single pod.

How can I get FQDN in Kubernetes?

You can do a DNS query from any pod and you would get the FQDN. cluster-domain. example is just a example in the documentation. cluster.


1 Answers

Headless Services are a group of Pod IPs. Pod IPs are not (generally) available outside the cluster/cloud-provider.

Are you trying to get external IPs for a headless service or are you within the same network (e.g. in the GCE project) but not in the cluster?

like image 98
Tim Hockin Avatar answered Sep 19 '22 07:09

Tim Hockin