Service Discovery
Explore service discovery and ClusterIP routing in Kubernetes.
We'll cover the following...
Applications use names to talk to other apps. However, they need to convert these names into IP addresses, which is where service discovery comes into play.
Assume we have a cluster with two apps called enterprise and cerritos. The enterprise app sits behind a ClusterIP
Service called ent, and the cerritos app sits behind one called cer. Kubernetes has assigned both Services a ClusterIP
, and the cluster DNS has automatically registered them. Right now, things are as follows.
App | Service name | Cluster IP |
Enterprise | ent | 192.168.201.240 |
Cerritos | cer | 192.168.200.217 |
If either of the apps wants to connect to the other, it needs to know its name and how to convert it to an IP.
Developers are responsible for coding applications with the names of the applications they consume, but Kubernetes automatically converts the names to IPs.
How Kubernetes handles Service Discovery
Consider an example where the enterprise app from the above figure needs to send requests to the cerritos app. For this to work, the enterprise app developers need to configure it with the name of the Service in front of the ...