A service IP, or cluster IP, is the internal address assigned to a Kubernetes Service. It gives workloads inside the cluster one address for reaching a group of pods, even when individual pod IPs change. Kubernetes normally assigns the address when the Service is created. section 11.1.2 section 11.7
Listing 11.1 YAML manifest for the quote Service object
apiVersion: v1 #1
kind: Service #1
metadata:
name: quote #2
spec:
type: ClusterIP #3
selector: #4
app: quote #4
ports: #5
- name: http #5
port: 80 #5
targetPort: 80 #5
protocol: TCP #5
This Service manifest requests type ClusterIP, selects pods labeled app: quote, and makes them available on port 80. It leaves the clusterIP field unset so Kubernetes can assign the address. section 11.1.2
Run kubectl get svc -o wide to see a Service’s CLUSTER-IP, ports, and label selector. The selector determines which pods receive traffic; the Service’s endpoints can change without changing its IP. Endpoints can also be managed manually when no selector is set. section 11.1.2 section 11.7
Call a Service from a pod
A pod can call a Service by IP, such as curl http://10.96.136.190, but an application can use its DNS name instead: curl http://quiz. A lookup of a Service’s A record returns its cluster IP; even a LoadBalancer Service’s internal DNS lookup returns the cluster IP rather than its external address. section 11.1.3 section 11.4.1
The IP is virtual: it works with a port defined by the Service. If curl reaches the Service but ping gets no replies, the failed ping does not establish that the Service is broken. The cluster IP is for access inside the cluster; NodePort and LoadBalancer services also provide access from outside. section 11.1.3 section 11.7


