<p>I know the basic concept of <code>ClusterIP</code> and <code>Headless</code> services.</p>
<p>I think the key different is <code>ClusterIP</code> do some sort of load balancing between underlying pods by applying some iptable rules.<br />
Then <code>Headless</code> just a list of ip addresses of pods registered in DNS.</p>
<p>And my question is, if <code>ClusterIP</code> do the &quot;load balancing&quot; job, does that mean the ingress controller just do the routing but not load balancing?<br />
What if using <code>Headless</code> as the service type, can I configure the ingress controller and let it take over the load balancing job?</p>
<p>Thanks.</p>

btwear
<p>Service carries mapping to all of the pods registered with it via selector labels, and to send traffic to any of pods, it is just required to communicate to that service only and it will select some pod to route the request to,   while headless service has nothing like clusterIP so it uses Pod's IP only, a chance to do direct communication with pods.</p>
<p>Say that you have a set of Kafka brokers deployed and you want to get info about a topic resting in one broker, then probably you can do that via headless service.</p>
<p>Now for these pods to talk to external world, they need to be exposed to load balancer layer, here comes the role of ingress that maps the domain URL to the backend services, and only ingress' service is exposed at the load balancer layer, rest remain under the hood.</p>
<p>The advantage of this is, you can attach firewall rules to ingress, URL rewrites can be done, sticky sessions can be implemented i.e. while services can't offer such things.</p>
