Skip to content →

What Does “Headless” Mean?

I recently saw someone call a Kubernetes Service, “headless”. I have also heard this term in the context of the Chrome web browser running in “headless” mode. It’s a confusing term to me, so let’s explore it.

“Headless” means not having a head. But what is a “head” in these contexts?

Here is the Kubernetes Service that gmr called “headless”.

kind: Service
apiVersion: v1
metadata:
  namespace: default
  name: rabbitmq
  labels:
    app: rabbitmq
spec:
  clusterIP: None            # <--- This is what makes it headless
  ports:
   - name: http
     protocol: TCP
     port: 15672
     targetPort: 15672
   - name: amqp
     protocol: TCP
     port: 5672
     targetPort: 5672
  selector:
    app: rabbitmq

By setting spec.clusterIP to None, the Service is headless. It no longer acts as a load balancer. In a way, it's like a lot of the overhead is removed and you are left with a stripped-down version of a Service.

A headless service is a service with a service IP but instead of load-balancing it will return the IPs of our associated. This allows us to reach each Pod directly, rather than the service acting as a load-balancer or proxy.

kaoskater08

I'm starting to see that "headless" might just mean part of an application instead of the full version.

How about Headless Chrome?

Headless Chrome is a way to run the Chrome browser in a headless environment without the full browser UI. Headless Chrome gives you a real browser context without the memory overhead of running a full version of Chrome.

Eric Bidelman

That makes sense. With automated web testing, you don't need a full-blown browser, only some of its functionality.

Summary

Headless means that you are only using part of an application's functionality.

Published in Today I Learned