A Kubernetes Service provides a stable logical endpoint for containers managed by Deployments. It routes traffic to matching Pods, balances requests across replicas, and lets clients use a service name instead of changing Pod IP addresses. section 2.1.2 section 2.3.4
A Service connects application workloads through several implementation elements:
- A selector such as app=frontend links the Service to Pods created by a Deployment. section 2.3.5
- A ClusterIP exposes the workload inside the cluster, while the Service forwards its port to a container target port. section 2.3.5
- Other services can address the endpoint by name and port without knowing Pod IP addresses. section 2.3.6
- Ingress handles traffic entering the cluster; it uses the Service as a backend rather than replacing it. section 2.3.6
Inspecting the frontend Service
Run kubectl get services to list endpoints, then kubectl describe service frontend to inspect its selector and endpoints. A frontend Service can select app=frontend, expose port 80, target port 8080, and route to multiple Pod addresses. section 2.3.5
Listing 2.6 Describing the Frontend service
Name: frontend
Namespace: default
Labels: app.kubernetes.io/managed-by=Helm
Annotations: meta.helm.sh/release-name: conference
meta.helm.sh/release-namespace: default
Selector: app=frontend #1
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.96.60.237
IPs: 10.96.60.237
Port: <unset> 80/TCP
TargetPort: 8080/TCP
Endpoints: 10.244.1.6:8080,10.244.2.9:8080
Session Affinity: None
Events: <none>
Use the frontend description to inspect the selector, ClusterIP, ports, target port, and currently routed endpoints. section 2.3.5











