Skip to main content
Course/Config & Health/Service Types Deep Dive
7/960 min
Config & Health

Service Types Deep Dive

ClusterIP, NodePort, LoadBalancer, ExternalName, and Headless β€” when to use each and how they work.

intermediate60 minRead β†’ Lab β†’ Quiz β†’ Practice
🧠 Brain Warm-Up
🧠 Brain Warm-Up: A ClusterIP service gives you a stable virtual IP inside the cluster. But that IP is not reachable from your laptop. What would you need to expose a service to external traffic? Think about the layers before reading.

Service Types Overview

TypeReachable FromUse Case
ClusterIPInside cluster onlyInternal microservice communication
NodePortNode IP + portDev/testing, basic external access
LoadBalancerExternal LB IPProduction cloud exposure
ExternalNameInside clusterAlias for external DNS name
Headless (clusterIP: None)Inside cluster (DNS only)StatefulSets, direct pod addressing

ClusterIP (Default)

A stable virtual IP assigned to the service. kube-proxy programs iptables/ipvs to forward traffic to matching pods.

Pod A β†’ ClusterIP:80 β†’ kube-proxy β†’ Pod B (one of the backends)

Cannot be reached from outside the cluster.

NodePort

Opens the same high port (30000–32767) on every node. Traffic to any node IP on that port reaches the service.

Laptop β†’ NodeIP:30080 β†’ kube-proxy β†’ Pod

NodePort builds on ClusterIP. The service still has a ClusterIP for internal traffic.

LoadBalancer

Cloud provider creates an external load balancer pointing to the NodePort. Gives you one stable external IP.

Internet β†’ ExternalIP:80 β†’ Cloud LB β†’ NodeIP:NodePort β†’ kube-proxy β†’ Pod

On minikube: use minikube tunnel to simulate the cloud LB.

ExternalName

Returns a CNAME DNS record. No proxying β€” pods that resolve the service name get the CNAME target.

spec:
  type: ExternalName
  externalName: my-database.us-east-1.rds.amazonaws.com

Headless (clusterIP: None)

DNS returns individual pod IPs instead of a single virtual IP. Used with StatefulSets for stable pod identity.