Is there a way to discover all the endpoints of a headless service from outside the cluster?
Preferably using DNS or Static IPs
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.
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.
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.
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With