User Tools

Site Tools


k8s:core:service

Service

A Service provides a stable network endpoint to access Pods.

Why needed

Pods are unstable:

  • IP changes when restarted
  • Pods can be recreated anytime

Service solves this problem by providing:

  • Stable DNS name
  • Stable IP inside cluster

Example

Service: my-api → routes to Pod A → routes to Pod B

Even if Pods change:

  • Service stays the same

Service types

  • ClusterIP → internal only
  • NodePort → access via node port
  • LoadBalancer → external cloud access
  • ExternalName → DNS mapping

Real-world analogy

Service = “front door”

Users do NOT talk to Pods directly. They talk to the Service.

k8s/core/service.txt · Last modified: by phong2018