A kubernetes service is the entry point to a group of pods. These pods have their own unique IP addresses.

A kubernetes service gets its IP address from the range of IP addresses reserved to services in the kubernetes cluster, also called the service CIDR range - --service-cidr -

The kube-dns resolves the names of the services to IP addresses.
For example the service: 
"service1.namespace1.svc.cluster.local" could be mapped for example to the IP address "10.55.3.2".

The kube-proxy, then defines the iptables rules to allow connection to these objects - pods -.


When a request reaches our above mentioned service "service1.namespace1.svc.cluster.local", the DNS resolves its name to the IP address "10.55.3.2", then the kube-proxy, using the iptables rules sends the request to one of the backing pods using a load-balancing algorithm.

Remark:

Kube-dns is the clusterIP service behind the CoreDNS pods.
Brando Sabatini and Ikbal C ©. Powered by Blogger.