Course contentsShow
← Cloud and Infrastructure
Lesson 1204 of 2,98924. Kubernetes NetworkingFree lesson

ClusterIP Service Type

Creating internal-only Services that provide stable IPs for communication within the cluster.

ClusterIP Service Type

What You'll Learn

You'll learn how to create internal-only Services that give your Pods stable, unchanging IP addresses for communication within the Kubernetes cluster.

The Problem ClusterIP Solves

Pods are ephemeral—they come and go, and their IP addresses change constantly. Imagine trying to connect your frontend application to a backend database when the database Pod's IP changes every time it restarts. ClusterIP Services solve this by acting like a stable phone number that never changes, even when the Pods behind it do.

What Is ClusterIP?

ClusterIP is the default Service type in Kubernetes. It creates a virtual IP address that's only accessible inside your cluster—no external traffic can reach it. This virtual IP remains constant and automatically load-balances requests across all healthy Pods that match the Service's selector.

Think of ClusterIP as an internal reception desk. External visitors can't reach it, but anyone inside the building (your cluster) can ask the reception desk to connect them to the right department (Pod), even if employees move between offices.

When to Use ClusterIP

Use ClusterIP for:

  • Database connections that only your apps need
  • Internal APIs and microservices communication
  • Backend services that shouldn't be exposed outside the cluster
  • Any Pod-to-Pod communication requiring stability

How It Works

When you create a ClusterIP Service, Kubernetes:

  1. Assigns a stable virtual IP from the cluster's service CIDR range
  2. Creates DNS records (e.g., my-service.default.svc.cluster.local)
  3. Uses kube-proxy to route traffic to matching Pods
  4. Load-balances across all healthy endpoints

Key Takeaway: ClusterIP Services provide stable, internal-only networking for Pods to communicate reliably within your cluster, abstracting away the complexity of changing Pod IPs.