Services in Kubernetes

TL;DR AI
2 min readKey summary
Pods are ephemeral: they come and go and their IPs change frequently.
A Service provides a stable IP and DNS and automatically load-balances traffic.
Services use selectors (e.g., selector: app: minha-api) to route traffic to any Pod with that label; they don't reference ReplicaSets or Deployments.
A Service load-balances traffic across all matching Pods (e.g., Pods A, B, C).
Configure port (Service port) vs targetPort (container port) and use named ports; prefer ClusterIP by default, use LoadBalancer only to expose externally, keep labels consistent and check endpoints.
