Kubernetes Simulator

intermediate · ~10 min

A fixed address

Ticket from Tom Okafor, product manager

Our marketplace partner is wiring catalog into their own load balancer. It can't use our ingress: it wants to send traffic to port 30080 on every one of our nodes, and it needs that port to stay put.

Please make catalog's API answer there, without changing how the frontend talks to catalog today. Their engineers will test from inside the network, the way you can from a frontend pod.

NodePort Services

A NodePort Service opens the same port, from 30000–32767, on every node; kube-proxy forwards it to the Service's pods, wherever they run. Set nodePort to choose it, or Kubernetes picks one at random. It also keeps a cluster IP, so pods can still use it by name. Docs

Objectives

  • Port 30080 on every node serves catalog's API
  • The frontend still reaches catalog by name
  • Bonus: Leave the catalog Service exactly as it was

Best on a computer with a keyboard. It works on a phone, with shortcuts under the terminal.