How do Kubernetes Services (ClusterIP, NodePort, LoadBalancer) and Ingress work?
Because Pods are ephemeral and their IP addresses change on restart, **Services** provide stable IP addresses and DNS names to load-balance traffic across pods matching a label selector:
• ClusterIP (default): Internal virtual IP accessible only within the cluster. • NodePort: Exposes the service on a static high port (30000–32767) on every cluster node's IP. • LoadBalancer: Provisions a cloud provider load balancer (AWS ALB, GCP Cloud LB). • Ingress: An API object that manages HTTP/HTTPS routing, SSL termination, and host/path-based routing to internal Services.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
spec:
rules:
- host: app.domain.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web-service
port:
number: 80Ingress acts as a smart reverse proxy, routing external domains and URL paths to internal ClusterIP services without paying for a separate cloud load balancer per service.
Ready for Scaling & Helm?
Take a quick test to evaluate yourself, or move straight to the next module.