World map

 

BM: Baca dalam Bahasa Melayu

World K3: Counters & Doors

EndpointSlices: who answers?

You will learn: to see which pods answer a Service, and fix one that nobody answers.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

You are here: cluster kind-dev namespace default
The menu's EndpointSlice shows unset ports and unset endpoints. wget gets Connection refused. Terminal output: $ kubectl get endpointslices -l kubernetes.io/service-name=menu NAME ADDRESSTYPE PORTS ENDPOINTS AGE menu-hhsm8 IPv4 <unset> <unset> 21s $ kubectl exec client -- wget -qO- -T 5 http://menu wget: can't connect to remote host (10.96.127.123): Connection refused command terminated with exit code 1

The menu has an order number, but you get Connection refused. Plain words: no tray stands behind that number.

Try it

An EndpointSlice: The list behind an order number: which ready pods a Service sends to. is the list behind an order number. It names the trays that answer. This Service wants both labels. Make it pick the two shop trays.

Drag a label onto a tray, or tap a label, then a tray.

Service shop (order number)

selector:app=shoptier=web

Picks 1 trays.

Labels

  • shop-1

    • app=shop
    • tier=web

    shop picks this tray.

  • shop-2

    • app=shop

    Not picked: needs tier=web.

  • api-1

    • app=api
    • tier=web

    Not picked: needs app=shop.

kubectl get endpointslices -l kubernetes.io/service-name=shopNAME         ADDRESSTYPE   PORTS   ENDPOINTS     AGEshop-2jl8t   IPv4          80      10.244.1.84   12s

Watch

You are here: cluster kind-dev namespace default
The shop's list has three IPs. After scaling to one tray, it has one IP. Terminal output: $ kubectl get endpointslices -l kubernetes.io/service-name=shop NAME ADDRESSTYPE PORTS ENDPOINTS AGE shop-4k2wd IPv4 80 10.244.1.4,10.244.2.4,10.244.1.5 21s $ kubectl scale deployment shop --replicas=1 deployment.apps/shop scaled $ sleep 10 $ kubectl get endpointslices -l kubernetes.io/service-name=shop NAME ADDRESSTYPE PORTS ENDPOINTS AGE shop-4k2wd IPv4 80 10.244.1.4 31s

The list follows the trays. Scale down to one, and the list shrinks to one. A tray that is not ready drops off too.

Try it

Detective time. Find why the menu has no trays. Then remake its order number.

You are here: cluster kind-dev namespace default
Stalls: 3. Trays: 5 (5 ready). Waiting for a stall: 0.
  • menu0/0 ready no ready trays
  • shop3/3 ready
dev-control-planeOpenManager

No trays here.

dev-workerOpen
  • client
  • shop·hj8bg
  • shop·rs5v6
dev-worker2Open
  • menu·n8ltw
  • shop·p7794
Time: +0s (sped up)

Predict

A tray fails its readiness probe. Does the order number still send it orders?

Pick one answer.

Check

A Service has no endpoints. Put the steps in order.

First step at the top. Put these in order. Use the arrows, or drag.

  • Check the endpoints again
  • Fix the selector or the labels
  • kubectl describe service menu (read the Selector)
  • kubectl get pods --show-labels
  • kubectl get endpointslices -l kubernetes.io/service-name=menu

You did it!

You can now see who answers a Service, and fix it.

Go deeper (optional)

The older Endpoints object is deprecated since Kubernetes 1.33. Use EndpointSlices. One slice holds up to 100 endpoints by default. A big Service gets several slices. A pod that is shutting down stays listed for a moment, marked not ready.

Real rep (optional), on a throwaway kind cluster:

Real mission

  1. kubectl get endpointslices -l kubernetes.io/service-name=shop
  2. kubectl create service clusterip nobody --tcp=80:80
  3. kubectl get endpointslices -l kubernetes.io/service-name=nobody

0 of 3 steps done · Your ticks are saved.