Tuesday, May 12, 2026

Types of Kubernetes Services

In Kubernetes, Services are abstractions that provide a stable network endpoint for a set of dynamic Pods. There are four primary service types, plus a specialized variant known as a "Headless" service. 


Core Kubernetes Service Types
  • ClusterIP (Default)
    • Visibility: Internal to the cluster only.
    • How it works: Kubernetes assigns a stable virtual IP address that is only reachable from within the cluster.
    • Use Case: Ideal for internal microservice communication, such as a backend API that only needs to talk to a frontend.
  • NodePort
    • Visibility: External.
    • How it works: Exposes the Service on each Node's IP at a static port (typically in the range 30000–32767). Traffic sent to is automatically routed to the Service.
    • Use Case: Useful for simple external access or testing when you don't have a cloud load balancer.
  • LoadBalancer
    • Visibility: External.
    • How it works: Automatically provisions a native load balancer from your cloud provider (like
      AWS ELB

      or GCP Load Balancer) to direct external traffic to the Service.
    • Use Case: The standard way to expose services to the internet in production environments.
  • ExternalName
    • Visibility: Internal redirect.
    • How it works: Maps the Service to a DNS name outside the cluster by returning a CNAME record (e.g., ). It does not use proxying or IP addresses.
    • Use Case: Used when your application needs to reach a service that lives outside the Kubernetes cluster. 
Specialized: Headless Service 

A Headless Service is created by setting in the configuration.
  • Purpose: It does not allocate a single stable IP. Instead, a DNS lookup returns the IP addresses of all underlying Pods directly.
  • Use Case: Essential for stateful applications like Kafka or MongoDB, where clients need to connect directly to specific individual Pods. 

No comments:

Post a Comment

JOURNEY-012 Added Evaluation Framework

  # ============================================================ # STEP 1 — INSTALL REQUIRED LIBRARIES # ===================================...