Service Registration

Learn about Service registration in Kubernetes.

What is Service registration

The most important thing to know about service registration on Kubernetes is that it’s automatic!

At a high level, we develop applications and put them behind Services for reliable names and IPs. Kubernetes automatically registers these Service names and IPs with the service registry.

From now on, we’ll call the service registry the cluster DNS.

Service registration process

There are three steps in service registration:

  1. Assign the Service a name

  2. Assign the Service an IP

  3. Register the name and IP with the cluster DNS

Developers are responsible for point one. Kubernetes is responsible for points two and three.

Consider a quick example.

We’re developing a new web app that other apps will connect to using the valkyrie-web name. To accomplish this, we put it behind a Service called valkyrie-web and post it to the API server. Kubernetes ensures the Service name is unique and automatically assigns it an IP address (ClusterIP). It also automatically registers the name and IP in the cluster DNS.

The registration process is automatic because the cluster DNS is a Kubernetes-native application that watches the API server for new Services. Every time it sees a new one, it gets its name and IP and automatically registers it. This means applications don’t need any service registration logic — we put them behind a Service, and the cluster DNS automatically registers them.

Summary of the Service registration process

The following figure summarises the service registration process and adds some of the details.

Get hands-on with 1400+ tech skills courses.