What are the differences between «Cluster IP Address» and «Pod IP Address» in Kubernetes?

2024-10-20--22-13-54

Aspect Pod IP Address Cluster IP Address
Definition IP address assigned to an individual pod Virtual IP assigned to a Kubernetes service
Scope Accessible within the node hosting the pod Accessible throughout the entire cluster
Lifespan Changes when a pod restarts or is rescheduled Remains constant as long as the service exists
Purpose Direct communication with a specific pod Load balances traffic across multiple pods
Stability Ephemeral and not stable for long-term connections Provides a stable endpoint for accessing services
Usage Used internally by Kubernetes for pod management Used by other pods and services for communication
Exposure Not exposed outside the cluster by default Can be exposed externally using service types like NodePort