<p>I am learning Kubernetes and currently deep diving into high availability and while I understand that I can set up a highly available control plane (API-server, controllers, scheduler) with local (or with remote) etcds as well as a highly available set of minions (through Kubernetes itself), I am still not sure where in this concept services are located.</p>

<p>If they live in the control plane: Good I can set them up to be highly available.</p>

<p>If they live on a certain node: Ok, but what happens if the node goes down or becomes unavailable in any other way?</p>

<p>As I understand it, services are needed to expose my pods to the internet as well as for loadbalancing. So no HA service, I risk that my application won't be reachable (even though it might be super highly available for any other aspect of the system).</p>

<p>Kubernetes Service is another REST Object in the k8s Cluster. There are following types are services. Each one of them serves a different purpose in the cluster.</p>

<ul>
<li>ClusterIP</li>
<li>NodePort </li>
<li>LoadBalancer</li>
<li>Headless</li>
</ul>

<p>fundamental Purpose of Services </p>

<ul>
<li>Providing a single point of gateway to the pods</li>
<li>Load balancing the pods</li>
<li>Inter Pods communication</li>
<li>Provide Stability as pods can die and restart with different Ip</li>
<li>more </li>
</ul>

<p>These Objects are <strong>stored in etcd</strong> as it is the single source of truth in the cluster. </p>

<p>Kube-proxy is the responsible for creating these objects. It uses selectors and labels. </p>

<p>For instance, each pod object has labels therefore service object has selectors to match these labels. Furthermore, Each Pod has endpoints, so basically kube-proxy assign these endpoints (IP:Port) with service  (IP:Port).Kube-proxy use IP-Tables rules to do this magic.</p>

<p>Kube-Proxy is deployed as DaemonSet in each cluster nodes so they are aware of each other by using etcd. </p>
