Skip to main content
InterviewHubPRO
Section Overview
Q10

Question 10 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

20%
Kubernetes (K8s) (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

Kubernetes Services: ClusterIP vs. NodePort vs. LoadBalancer vs. Headless.

junior LevelMost AskedKubernetes

In Simple Words: Pods are ephemeral; when replaced, they receive new IP addresses. A Service provides a single stable IP address and DNS name that load-balances traffic across matching Pods.

  1. ClusterIP (Default):
    • Exposes the service on a cluster-internal private IP.
    • Accessible only from inside the cluster. Perfect for internal microservice-to-microservice communication.
  2. NodePort:
    • Exposes the service on a static high-numbered port (30000-32767) on every worker node's physical IP address.
    • Accessible externally via <NodeIP>:<NodePort>.
  3. LoadBalancer:
    • Integrates with cloud providers (AWS NLB, GCP Cloud Load Balancer, Azure LB).
    • Automatically provisions a public cloud load balancer that routes external internet traffic into the cluster's NodePort.
  4. Headless Service (clusterIP: None):
    • Does not allocate a virtual IP. DNS queries return the raw A records of all matching Pod IPs directly. Used for StatefulSets (Kafka, Cassandra, Cassandra nodes discovering each other).