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.