Menu

1 / 2

Kubernetes Services — How Your App Finally Talks to the World

DEV Community·Linta Paul·6 months ago
#XfPGprqP
#kubernetes#devops#beginners#pods#service
Reading 0:00
15s threshold

The Problem — Your App is Invisible

You deployed your app in Kubernetes. Pods are running.

But open a browser — nothing loads.

Why? Pods are isolated by default. They have internal IPs

that the outside world cannot reach. And those IPs change

every time a Pod restarts.

What a Kubernetes Service Does

A Service gives your app a stable, permanent endpoint —

a fixed IP and port that stays the same no matter what

happens to your Pods.

It does three things:

Exposes a stable IP and port

Groups the right Pods using selectors (labels)

Automatically reroutes traffic if a Pod crashes

The 3 Types of Services

Type Who Can Access Use Case

ClusterIP Inside cluster only Microservices

NodePort Same network Local testing

LoadBalancer The internet Production

A Real Service YAML

apiVersion : v1 kind : Service metadata : name : my-web-service spec : type : LoadBalancer selector : app : my-web-app # finds pods with this label ports : - port : 80 targetPort : 8080

Enter fullscreen mode

Exit fullscreen…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.