Thursday, July 3, 2025

Kubernetes Service

 What is the point of a Service in Kubernetes

Accessing a pod by name or IP directly is fragile and not recommended for long-term connectivity.  

A Kubernetes Service does load balancing across pods that match its selector (usually labels).

A Kubernetes Service provides a stable way to access one or more pods by grouping them using labels. This is essential because pods are ephemeral and their IPs can change.

You can do port forwarding to a service, or have your service be of type load balancer or cluster ip which is the default setting.

Bottom line use a service as an endpoint and let kubernetes manage all the pods behind that service. 



No comments:

Post a Comment

Kubernetes Service

 What is the point of a Service in Kubernetes Accessing a pod by name or IP directly is fragile and not recommended for long-term connectiv...