Creating a Governing Headless Service

Learn how to create a governing headless Service.

We'll cover the following

It’s helpful to visualize Service objects with a head and a tail. The head is the stable ClusterIP address, and the tail is the list of Pods it forwards traffic to. A headless Service is just a Service object without a ClusterIP address.

The primary purpose of headless Services is to create DNS SRV records for StatefulSet Pods. Clients query DNS for individual Pods and send queries directly to those Pods instead of via the Service’s ClusterIP. This is why headless Services don’t have a ClusterIP.

Define a headless Service

The following YAML is from the headless-svc.yml file and describes a headless Service called dullahan with no IP address (spec.clusterIP: None).

Get hands-on with 1400+ tech skills courses.