A service IP is a cluster-local address for reaching a Kubernetes Service from other Pods. It is normally unavailable from the public internet. A Service provides a stable access point even while its Pods change, and routes traffic only to running Pods that can receive it. section 3.2.5 section 7.1.2
A service IP supports several practical deployment behaviors:
- Connects applications inside a microservice architecture without exposing every application publicly. section 7.0
- Load-balances requests across selected Pods and adapts as replicas become unavailable or temporarily exceed the desired count during rollout. section 3.2.5
- Supports service discovery through environment variables and DNS, avoiding dependence on manually recorded addresses. section 7.3
- Differs from an external IP: a ClusterIP Service has no external IP, while other Service types can additionally expose an application. section 7.1.2 section 3.2.5
Calling an internal service
A Robohash Service receives the cluster IP 10.63.254.218. Other Pods can request http://10.63.254.218/example, but a client outside the cluster cannot normally reach that address. For local testing, kubectl port-forward service/robohash-internal 8080:80 makes the service available at localhost:8080. section 7.1.2
Listing 7.2 Chapter07/7.1_InternalServices/robohash-service.yaml
apiVersion: v1
kind: Service
metadata:
name: robohash-internal
spec:
selector:
app: robohash
ports:
- port: 80
targetPort: 80
protocol: TCP
type: ClusterIP #1
#1 Defines a local service
Shows a ClusterIP Service definition that selects Pods by label and maps its service port to the Pod port. section 7.1.2


