Skip to content
BENIBIX Learn

Kubernetes Service vs Kubernetes Ingress

People think a service and an ingress do the same job, and they do not. A service gives a group of pods one steady address inside the cluster. An ingress lets web traffic in from outside, and sends each site or path to the right service. Traffic from the internet usually passes through both, the ingress first.

Infrastructure☸️ Container Orchestration

Kubernetes Service

A steady name and address for a changing group of pods. It shares traffic among them.

A Kubernetes service gives a group of pods one steady name and address. Pods come and go, and each new one gets a new address. The service keeps track of which pods are alive right now. It picks them by a label, like app: shop. Any request sent to the service is passed on to one of those pods.

Example
Jack's web pods call the database through a service named db. The database pod is replaced twice in a week, and the web pods never notice.
Why it matters
With no service, each app would have to chase the new address of each pod it calls.
Full entry
Infrastructure☸️ Container Orchestration

Kubernetes Ingress

Rules that let web traffic in. They send each site to the right service.

A Kubernetes ingress lets web traffic from outside reach services inside the cluster. It holds rules, like send shop.example.com to the shop service. The rules do nothing alone. A program called an ingress controller reads them and sends the traffic. It can also handle HTTPS, so one way in serves many sites. The Kubernetes team now says to use Gateway, a newer way, for new work.

Example
One cluster hosts a shop and a blog on one public address. The ingress sends each web address to its own service.
Why it matters
Without it, each app would need its own public address. One ingress can serve many sites from one way in.
Full entry

In one line

Kubernetes Service
A steady name and address for a changing group of pods. It shares traffic among them.
Kubernetes Ingress
Rules that let web traffic in. They send each site to the right service.