CKA prep, by exam domain · Lesson 9 of 12 · about 50 minutes

Ingress and the Gateway API

Getting web traffic into the cluster: an Ingress that does nothing until a controller arrives, the Gateway API's Gateways and HTTPRoutes, what their status conditions tell you when a route fails, and a Helm value that was silently ignored along the way.

Exam domain: Services and networking · 20% of the exam

By the end you'll know

  • Why an Ingress does nothing on its own, and how to spot one that nobody is handling
  • The difference between a CRD (CustomResourceDefinition) and a controller
  • How to install the Gateway API and a controller that serves both Ingress and Gateways
  • How a Gateway and an HTTPRoute fit together, and what Accepted, ResolvedRefs and Programmed mean
  • Why a broken backend gives a 500, and a refused route gives a 404
  • Why a default IngressClass doesn't fix Ingresses that already exist
  • The right order to remove a Helm release, and what's left behind if you get it wrong

Before you start

  • You need: the cluster from Lesson 2, all nodes Ready, and Helm on cp1 from Lesson 7.
  • The output below is from real runs on November 28 and 29, 2026, in New York, on an Apple silicon Mac.

Lesson 8 got traffic to a Service from inside the cluster and through a node port. This lesson is the front door: one entry point that sends web requests to different apps by host name and path. The exam's curriculum names both ways of doing it, Ingress and the newer Gateway API, in the Services and networking domain.

A note on controllers. Most guides use ingress-nginx, the community's NGINX controller. It was retired in March 2026, with no more releases or security fixes, so this lesson uses Traefik instead. One Helm install gives you a controller for both Ingress and the Gateway API. The commands for Ingresses, Gateways and HTTPRoutes are the same whichever controller a cluster runs.

What's there before you start

(cp1)

BASH
k get ingressclass
k get crd | grep gateway
k get gatewayclass
Code
vagrant@cp1:~$ k get ingressclass
No resources found
vagrant@cp1:~$ k get crd | grep gateway
vagrant@cp1:~$ k get gatewayclass
error: the server doesn't have a resource type "gatewayclass"

Three different answers, and each says something:

  • No resources found: the IngressClass type exists (it's built into Kubernetes), but there are none. No Ingress controller is installed.
  • No output from grep: no Gateway API CRDs. grep prints nothing when nothing matches; it isn't an error.
  • the server doesn't have a resource type: a different failure. The type itself doesn't exist, because no CRD defines it. When you see this wording, check k get crd.

Two apps

(cp1)

BASH
k create ns gw-lab
k -n gw-lab create deploy web --image=nginx:1.27-alpine --port=80
k -n gw-lab expose deploy web --port=80
k -n gw-lab create deploy api --image=hashicorp/http-echo --port=5678 -- /http-echo -text=api
k -n gw-lab expose deploy api --port=80 --target-port=5678
k -n gw-lab get pods,svc
  • web is nginx, which serves its welcome page on port 80.
  • api is http-echo, a tiny server that replies with whatever -text says. Everything after -- replaces the container's command. It listens on 5678.
  • --target-port=5678: the api Service listens on 80 and forwards to 5678 in the pod. Two apps that answer differently make it obvious which one a request reached.

My first try had a typo:

Code
vagrant@cp1:~$ k -n gw-lab create deploy web --immage=nginx:1.27-alpine --port=80
error: unknown flag: --immage

kubectl rejects a misspelled flag immediately. Keep that in mind: later in this lesson, Helm doesn't.

Code
NAME                       READY   STATUS    RESTARTS   AGE
pod/api-79c5d5cb7b-dxxq9   1/1     Running   0          67s
pod/web-6bd858c6f9-kkznd   1/1     Running   0          2m56s

NAME          TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/api   ClusterIP   10.97.24.15     <none>        80/TCP    26s
service/web   ClusterIP   10.98.136.240   <none>        80/TCP    2m16s

An Ingress with no controller

An Ingress is a set of routing rules for web traffic coming into the cluster. Here, lab.local goes to web, and lab.local/api goes to api:

(cp1)

BASH
k -n gw-lab create ingress lab --rule="lab.local/*=web:80" --rule="lab.local/api*=api:80"
k -n gw-lab get ingress lab
k -n gw-lab describe ingress lab
  • --rule="HOST/PATH=SERVICE:PORT": one rule per flag.
  • /* means this path and everything under it (a Prefix match). Without the *, the path must match exactly.
  • The longer path wins, so /api/x goes to api and everything else to web.
  • No --class on purpose, to see what happens.

I mistyped the first rule, and the error is worth reading:

Code
vagrant@cp1:~$ k -n gw-lab create ingress lab --rule="lab.local/*=web*80" --rule="lab.local/api*=api:80"
error: rule lab.local/*=web*80 is invalid and should be in format host/path=svcname:svcport[,tls[=secret]]

The error prints the correct format. When you forget the syntax, k create ingress --help or a wrong attempt gives it back faster than the docs. The fixed command worked:

Code
NAME   CLASS    HOSTS       ADDRESS   PORTS   AGE
lab    <none>   lab.local             80      15s
Code
Name:             lab
Namespace:        gw-lab
Address:          
Ingress Class:    <none>
Default backend:  <default>
Rules:
  Host        Path  Backends
  ----        ----  --------
  lab.local   
              /      web:80 (10.244.189.122:80)
              /api   api:80 (10.244.189.123:5678)
Annotations:  <none>
Events:       <none>

The Services are right. The part in brackets is the pod IP and port each Service found. api:80 ending at :5678 is the targetPort doing its job, the exact thing ticket 10 in Lesson 4 broke.

But nobody is acting on it. Three clues say the same thing:

  • Ingress Class: <none>: no class was named, and there's no default class.
  • Address is blank: a controller fills this in when it takes ownership.
  • Events: <none>: no controller has logged anything about it.

The API server accepted the Ingress because it's a valid object. Valid doesn't mean working.

Controllers and CRDs

An Ingress is only rules written down. Something has to read them and route traffic: an Ingress controller, a program running in the cluster.

You've met this pattern before. A controller watches objects and makes reality match them, in a loop. The kube-controller-manager on cp1 is a bundle of them: create a Deployment, and its Deployment controller creates a ReplicaSet. A CRD (CustomResourceDefinition) is different: it only adds a new kind of object to the API, so the API server will store and validate it. In Lesson 7, you created a Backup object from your own CRD, and nothing backed anything up. That was a CRD with no controller, the same situation your Ingress is in now.

PieceWhat it isBuilt in?
Ingress, IngressClassAPI object kindsYes
Ingress controllerA program that reads Ingresses and routes trafficNo, you install one
Gateway, HTTPRoute, GatewayClassKinds defined by CRDsNo, the Gateway API CRDs add them
Gateway controllerA program that reads Gateways and routesNo, you install one

So an Ingress needs one install (a controller), and the Gateway API needs two (its CRDs, then a controller). The CRD teaches the API server a new noun; the controller makes the noun do something.

Install the Gateway API and Traefik

First, the Gateway API's CRDs, from its own release:

(cp1)

BASH
k apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.6.1/standard-install.yaml
k get crd | grep gateway
  • --server-side: the API server does the apply. These CRDs are too large for a normal apply, which keeps a full copy of each object in an annotation, and annotations have a size limit.
  • standard-install.yaml: the stable resources. There's also an experimental channel with resources still being designed.
Code
customresourcedefinition.apiextensions.k8s.io/backendtlspolicies.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/gatewayclasses.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/gateways.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/grpcroutes.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/httproutes.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/listenersets.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/referencegrants.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/tcproutes.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/tlsroutes.gateway.networking.k8s.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/udproutes.gateway.networking.k8s.io serverside-applied
validatingadmissionpolicy.admissionregistration.k8s.io/safe-upgrades.gateway.networking.k8s.io serverside-applied
validatingadmissionpolicybinding.admissionregistration.k8s.io/safe-upgrades.gateway.networking.k8s.io serverside-applied
Code
gatewayclasses.gateway.networking.k8s.io     Cluster      v1(storage),v1beta1   2026-11-28T22:14:03Z
gateways.gateway.networking.k8s.io           Namespaced   v1(storage),v1beta1   2026-11-28T22:14:03Z
httproutes.gateway.networking.k8s.io         Namespaced   v1(storage),v1beta1   2026-11-28T22:14:03Z
...
  • Ten new kinds. The ones that matter here are GatewayClass, Gateway and HTTPRoute.
  • safe-upgrades is a built-in validation policy that stops someone installing older Gateway API CRDs over newer ones.
  • GatewayClass is Cluster-scoped, like an IngressClass or a node. Gateways and routes are Namespaced.
  • v1(storage) is the version etcd keeps. Write apiVersion: gateway.networking.k8s.io/v1 in your YAML.

Then Traefik, with Helm:

(cp1)

BASH
helm repo add traefik https://traefik.github.io/charts
helm repo update
helm search repo traefik/traefik
helm install traefik traefik/traefik -n traefik --create-namespace --version 42.3.0 \
  --set service.type=NodePort \
  --set ports.web.nodePort=30080 \
  --set providers.kubernetesGateway.enabled=true
  • --version 42.3.0: pins the chart. By the time I ran helm search the next day, the newest chart was already 43.0.0, with a newer Traefik. Without a pin, the same command installs something different tomorrow.
  • --set ports.web.nodePort=30080: fixes Traefik's web port on every node at 30080, so it isn't random.
  • --set providers.kubernetesGateway.enabled=true: turns on Traefik's Gateway API support. Ingress support is on by default.
  • --set service.type=NodePort: there's no cloud load balancer here (Lesson 8's LoadBalancer stayed <pending>). Watch what happens to this one.
Code
NAME: traefik
NAMESPACE: traefik
STATUS: deployed
REVISION: 1
NOTES:
traefik with docker.io/traefik:v3.7.17 has been deployed successfully on traefik namespace!

⚠️ DEPRECATION WARNING: Gateway API CRDs will no longer be shipped with this chart in a future major version.
You will need to install them yourself before deploying Traefik v3.7:
  kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.1/standard-install.yaml

The warning tells you to install the Gateway API CRDs yourself, which you already did. It names v1.5.1, but it's a generic message: Traefik's own documentation for v3.7 lists v1.6.1 as supported, and the next check confirms it works.

(cp1)

BASH
k -n traefik get pods,svc
k get ingressclass
k get gatewayclass
Code
NAME                           READY   STATUS    RESTARTS   AGE
pod/traefik-7bb8986686-cgs88   1/1     Running   0          11s

NAME              TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
service/traefik   LoadBalancer   10.96.177.158   <pending>     80:30080/TCP,443:30927/TCP   11s
Code
NAME                CONTROLLER                      PARAMETERS   AGE
traefik (default)   traefik.io/ingress-controller   <none>       3m51s
Code
NAME      CONTROLLER                      ACCEPTED   AGE
traefik   traefik.io/gateway-controller   True       26s
  • The chart created an IngressClass, marked (default), and a GatewayClass, both named traefik.
  • ACCEPTED True on the GatewayClass means a running controller has claimed it. It's the Gateway API's version of "is anyone home?". A GatewayClass that isn't accepted is the first thing to check when Gateways do nothing.
  • The Service is LoadBalancer, not NodePort. I asked for NodePort. More on that below. It still works, because a LoadBalancer Service is a NodePort Service plus a request for an external address: port 30080 is open on every node, and only the external address stays <pending>.

The value Helm ignored

(cp1)

BASH
helm get values traefik -n traefik
helm show values traefik/traefik --version 42.3.0 | grep -n "LoadBalancer"
helm show values traefik/traefik --version 42.3.0 | sed -n 1155,1163p
  • helm get values RELEASE -n NS: only the values you passed.
  • helm show values CHART --version V: the chart's defaults, without installing anything. That's where the real key names are.
  • sed -n 1155,1163p: prints lines 1155 to 1163 only. -n stops sed printing every line, and p prints the range.
Code
USER-SUPPLIED VALUES:
ports:
  web:
    nodePort: 30080
providers:
  kubernetesGateway:
    enabled: true
service:
  type: NodePort
Code
941:    # Defines whether the port is exposed if service.type is LoadBalancer or
1162:    type: LoadBalancer
Code
  # -- Additional entries here will be added to the Service [spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.35/#servicespec-v1-core).
  # Cannot contain selector or ports entries.
  spec:
    type: LoadBalancer

The real key is service.spec.type. Helm stored service.type without a word, and nothing in the chart ever read it. It's the same trap as replicanCount in Lesson 7: Helm doesn't check --set keys against the chart. Before you --set anything, find the key in helm show values. The fix comes after the routing, with --reuse-values.

The Ingress works now

(cp1)

BASH
curl -s -H "Host: lab.local" http://192.168.34.155:30080/ | head -4
curl -s -H "Host: lab.local" http://192.168.34.155:30080/api
  • 192.168.34.155:30080: worker1 and Traefik's node port. Any node's IP works.
  • -H "Host: lab.local": sets the Host header. There's no DNS entry for lab.local, and Ingress rules match on this header, so you set it yourself.
  • -s hides the progress bar, and | head -4 keeps only the first 4 lines of nginx's page.
Code
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
api

Traefik picked up the class-less Ingress: / reached nginx, and /api reached http-echo. Yet k get ingress still showed CLASS <none> and a blank ADDRESS. Two things explain that:

  • Traefik also handles Ingresses with no class. That's Traefik's choice; other controllers may ignore them. Don't rely on it.
  • ADDRESS stays blank because Traefik's own external address is <pending>. A controller copies its Service's external address into the Ingress, and there's nothing to copy. On this cluster, a blank ADDRESS doesn't prove an Ingress is ignored. Test it.

A default class only applies at creation

(cp1)

BASH
k -n gw-lab create ingress lab2 --rule="new.local/*=web:80"
k -n gw-lab get ingress
Code
NAME   CLASS     HOSTS       ADDRESS   PORTS   AGE
lab    <none>    lab.local             80      14m
lab2   traefik   new.local             80      0s

lab2 got the class; lab didn't. When an Ingress is created with no class, the API server fills in the default class at that moment. lab was made before a default existed, and nothing goes back to update it. If a new controller is installed and old Ingresses do nothing, this is why: set the class on each one, or recreate it.

The Gateway API: a Gateway and an HTTPRoute

The Gateway API splits the Ingress into two objects:

  • A Gateway is the entry point: which controller handles it (gatewayClassName) and which ports and protocols it accepts (its listeners). Often a cluster admin owns it.
  • An HTTPRoute holds the routing rules: which Gateway it attaches to (parentRefs), which host names it serves, and where each path goes (backendRefs). Often an app team owns it.

There's no k create command for either. Start from an example in the Gateway API docs and change the names.

(cp1)

BASH
k get gateway -A
Code
NAMESPACE   NAME              CLASS     ADDRESS   PROGRAMMED   AGE
traefik     traefik-gateway   traefik             True         5m5s

The chart made a Gateway of its own. Checking first is a good habit: there may already be one to attach to. We'll make our own in gw-lab and come back to this one.

(cp1)

BASH
cat > gateway.yaml <<'EOF'
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: lab-gw
  namespace: gw-lab
spec:
  gatewayClassName: traefik
  listeners:
  - name: http
    protocol: HTTP
    port: 8000
EOF
cat > route.yaml <<'EOF'
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: lab
  namespace: gw-lab
spec:
  parentRefs:
  - name: lab-gw
  hostnames: ["gw.local"]
  rules:
  - matches:
    - path: { type: PathPrefix, value: /api }
    backendRefs:
    - name: api
      port: 80
  - backendRefs:
    - name: web
      port: 80
EOF
k apply -f gateway.yaml -f route.yaml
k -n gw-lab get gateway,httproute
k -n gw-lab describe gateway lab-gw | tail -25
  • gatewayClassName: traefik hands the Gateway to Traefik, the way --class does for an Ingress.
  • port: 8000 is a Traefik detail. Traefik's web entry point listens on 8000 inside its pod, and the Service maps 80 and 30080 to it. Traefik wants the listener on the pod's port; other controllers do this differently.
  • The second rule has no matches, so it catches everything the first rule doesn't, like /* in the Ingress.
  • gw.local keeps these requests apart from the Ingress's lab.local, though both arrive on port 30080.
Code
NAME                                       CLASS     ADDRESS   PROGRAMMED   AGE
gateway.gateway.networking.k8s.io/lab-gw   traefik             True         0s

NAME                                      HOSTNAMES      AGE
httproute.gateway.networking.k8s.io/lab   ["gw.local"]   0s
Code
      Reason:                Accepted
      Status:                True
      Type:                  Accepted
      ...
      Reason:                ResolvedRefs
      Status:                True
      Type:                  ResolvedRefs
      ...
      Reason:                Programmed
      Status:                True
      Type:                  Programmed
    Name:                    http
    Supported Kinds:
      Group:  gateway.networking.k8s.io
      Kind:   HTTPRoute
      Group:  gateway.networking.k8s.io
      Kind:   GRPCRoute

These conditions are how every Gateway API object reports its health:

ConditionMeansIf False, look at
AcceptedThe controller agreed to handle itThe class name, or a port or setting the controller can't use
ResolvedRefsEverything it points at existsA missing Service, or a missing TLS Secret
ProgrammedThe config is live in the proxyThe controller's logs

Supported Kinds lists what this listener accepts: HTTPRoute and GRPCRoute. A TCPRoute couldn't attach to an HTTP listener.

(cp1)

BASH
curl -s -H "Host: gw.local" http://192.168.34.155:30080/ | head -4
curl -s -H "Host: gw.local" http://192.168.34.155:30080/api
Code
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
api

Same apps, same port, routed by the HTTPRoute this time.

Breaking routes on purpose

Two failures, each with its own fingerprint. First, the healthy route's status:

(cp1)

BASH
k -n gw-lab describe httproute lab | tail -22
Code
Status:
  Parents:
    Conditions:
      Observed Generation:   1
      Reason:                Accepted
      Status:                True
      Type:                  Accepted
      Observed Generation:   1
      Reason:                ResolvedRefs
      Status:                True
      Type:                  ResolvedRefs
    Controller Name:         traefik.io/gateway-controller
    Parent Ref:
      Group:  gateway.networking.k8s.io
      Kind:   Gateway
      Name:   lab-gw

A route reports its status per parent: one block for each Gateway it attaches to.

A typo in a backend name

(cp1)

BASH
sed -i 's/name: api$/name: apii/' route.yaml
k apply -f route.yaml
curl -s -o /dev/null -w "%{http_code}\n" -H "Host: gw.local" http://192.168.34.155:30080/api
k -n gw-lab describe httproute lab | tail -22
sed -i 's/name: apii$/name: api/' route.yaml
k apply -f route.yaml
  • sed -i 's/OLD/NEW/' FILE: edits the file in place. $ means end of line, so only the line ending in exactly name: api changes.
  • curl -o /dev/null -w "%{http_code}\n": throws the page away and prints only the HTTP status code.
  • The last two lines put the name back.
Code
500
Code
      Observed Generation:   2
      Reason:                Accepted
      Status:                True
      Type:                  Accepted
      Message:               Cannot load HTTPBackendRef gw-lab/apii: getting service: service "apii" not found
      Observed Generation:   2
      Reason:                BackendNotFound
      Status:                False
      Type:                  ResolvedRefs
  • Accepted is still True: the Gateway took the route. Only the backend lookup failed.
  • ResolvedRefs: False, BackendNotFound, and the message names the missing Service.
  • A 500, not a 404. The Gateway API's rule: a request that matches a route with a broken backend gets a 500, so you can tell it apart from "nothing matched".
  • Observed Generation went from 1 to 2. The controller has read your edit. If it hasn't changed, the controller hasn't seen the change yet.

A route the Gateway won't take

The chart's traefik-gateway lives in namespace traefik. A route can name a Gateway in another namespace with namespace: in its parentRefs:

(cp1)

BASH
cat > route2.yaml <<'EOF'
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: shared
  namespace: gw-lab
spec:
  parentRefs:
  - name: traefik-gateway
    namespace: traefik
  hostnames: ["shared.local"]
  rules:
  - backendRefs:
    - name: web
      port: 80
EOF
k apply -f route2.yaml
k -n gw-lab describe httproute shared | tail -22
curl -s -o /dev/null -w "%{http_code}\n" -H "Host: shared.local" http://192.168.34.155:30080/
Code
      Reason:                NotAllowedByListeners
      Status:                False
      Type:                  Accepted
      Reason:                ResolvedRefs
      Status:                True
      Type:                  ResolvedRefs
    ...
      Name:       traefik-gateway
      Namespace:  traefik
Code
404
  • This time Accepted is False: the Gateway refused the route. ResolvedRefs: True shows the backend was fine; the problem is permission.
  • A 404, because as far as Traefik is concerned, no route for shared.local exists.

Why it was refused:

(cp1)

BASH
k -n traefik get gateway traefik-gateway -o yaml | grep -A3 allowedRoutes
Code
  - allowedRoutes:
      namespaces:
        from: Same
    name: web

Each listener has an allowedRoutes setting. Same, the default, accepts routes from the Gateway's own namespace only. The Gateway's owner decides who may attach; a route can't force its way in. So the fix goes on the Gateway, not the route: from: All, or from: Selector with a label that picks the namespaces allowed.

You getConditionLikely cause
404Accepted: FalseWrong Gateway name, or the listener doesn't allow the route's namespace
500ResolvedRefs: FalseBackend Service name or port wrong
404Both TrueThe host or path you sent doesn't match the route

Fixing the ignored value

Back to the Service that should have been a NodePort:

(cp1)

BASH
helm upgrade traefik traefik/traefik -n traefik --version 42.3.0 --reuse-values --set service.spec.type=NodePort
k -n traefik get svc traefik
helm history traefik -n traefik
  • --reuse-values: keeps everything you set before. Without it, upgrade would forget the node port and the Gateway API setting (Lesson 7).
  • --set service.spec.type=NodePort: the key the chart actually reads.
Code
NAME      TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
traefik   NodePort   10.96.177.158   <none>        80:30080/TCP,443:30927/TCP   18h
Code
REVISION	UPDATED                 	STATUS    	CHART         	APP VERSION	DESCRIPTION     
1       	Sat Nov 28 22:15:12 2026	superseded	traefik-42.3.0	v3.7.17    	Install complete
2       	Sun Nov 29 16:38:32 2026	deployed  	traefik-42.3.0	v3.7.17    	Upgrade complete

NodePort now, same node port, and revision 2 in the history.

How the drills work

Each drill is a task to do from a blank terminal. Try it first, without looking. Then open "Show the fast way" to compare your commands, and read the notes under them: they cover the part people usually get wrong. Repeat a drill a few days later until you can do it cold, because the exam leaves little time to look things up.

The drills

In namespace NS, create an Ingress named site for host shop.example.com: /api goes to Service api on port 80, everything else to Service web on port 80. Use the cluster's Ingress class, and prove both paths work.

Show the fast way
BASH
k get ingressclass
k create ingress site -n NS --class=CLASS \
  --rule="shop.example.com/*=web:80" \
  --rule="shop.example.com/api*=api:80"
k describe ingress site -n NS
curl -s -H "Host: shop.example.com" http://NODE-IP:NODE-PORT/api

Check the class first, and pass it even if one is marked default. In describe, each backend should show a pod IP in brackets; an empty one means the Service has no endpoints (Lesson 4). Find the controller's node port with k get svc -A | grep -i node.

A Gateway already exists in namespace NS. Route host app.example.com to Service web on port 80 with an HTTPRoute, and confirm the route was accepted.

Show the fast way
BASH
k get gateway -A
YAML
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: app
  namespace: NS
spec:
  parentRefs:
  - name: GATEWAY-NAME
  hostnames: ["app.example.com"]
  rules:
  - backendRefs:
    - name: web
      port: 80
BASH
k apply -f route.yaml
k describe httproute app -n NS | tail -20

Find the Gateway's real name first. If it's in another namespace, add namespace: under parentRefs, and check its listener's allowedRoutes. Done means Accepted: True and ResolvedRefs: True.

An HTTPRoute returns a 404 for every request. Find out why.

Show the fast way
BASH
k describe httproute NAME -n NS | tail -22
k get gateway -A
k get gateway GW -n GWNS -o yaml | grep -A3 allowedRoutes

Accepted: False with NotAllowedByListeners: the Gateway doesn't allow the route's namespace. Accepted: False with another reason: check the Gateway name in parentRefs. Both True: compare the route's hostnames and paths with what you're sending. A 500 instead points at ResolvedRefs and the backend.

Install a chart, setting its Service type to NodePort. Make sure the setting took effect.

Show the fast way
BASH
helm show values REPO/CHART | grep -n -B3 "type:"
helm install NAME REPO/CHART -n NS --create-namespace --set REAL.KEY=NodePort
helm get values NAME -n NS
k get svc -n NS

Find the key in helm show values before you --set it. Helm accepts any key without complaint, so the only proof is the object itself: k get svc must say NodePort. To fix it afterwards, helm upgrade with --reuse-values.

On exam day

  • Check k get ingressclass and pass --class. An Ingress with no class may be ignored, depending on the controller.
  • Check k get gateway -A before writing a route, and copy the Gateway's exact name and namespace.
  • Read the conditions: k describe on the route, then the Gateway. They usually name the problem in plain words.
  • Test with a Host header, curl -H "Host: NAME", when the host name has no DNS entry.
  • Copy Gateway API YAML from the docs. There's no k create shortcut for it.

Clean up

The right order is helm uninstall first, then delete the namespace:

(cp1)

BASH
k delete ns gw-lab
helm uninstall traefik -n traefik
k delete ns traefik
rm gateway.yaml route.yaml route2.yaml

I did it the other way round, and it's worth seeing why the order matters:

Code
vagrant@cp1:~$ k delete ns traefik -n traefik
Warning: deleting cluster-scoped resources, not scoped to the provided namespace
namespace "traefik" deleted
vagrant@cp1:~$ k delete ns gw-lab
namespace "gw-lab" deleted
vagrant@cp1:~$ helm uninstall traefik -n traefik
Error: uninstall: Release not loaded: traefik: release: not found
  • The warning: a namespace is itself cluster-scoped, so -n means nothing on it.
  • Helm keeps each release's records as Secrets in the release's namespace. Deleting the namespace deleted them, so helm uninstall had nothing to go on.
  • Deleting a namespace only removes what lives in it. The chart also made cluster-scoped objects, and they were all still there, including the IngressClass marked as the default. It would have stamped traefik onto every new Ingress, with no controller behind it.

The leftovers, found and removed by hand:

(cp1)

BASH
k get ingressclass,gatewayclass
kubectl get clusterrole,clusterrolebinding -o name | grep traefik
k delete ingressclass traefik
k delete gatewayclass traefik --wait=false
kubectl get clusterrole,clusterrolebinding -o name | grep traefik | xargs kubectl delete
k get crd -o name | grep traefik.io
  • -o name: prints each object as kind/name, one per line, ready to pipe into another command.
  • | xargs kubectl delete: passes those names to kubectl delete. It must be kubectl, not k: xargs runs the program directly, and the k alias only exists in your shell.
  • --wait=false: returns at once. A GatewayClass has a finalizer, a hold its controller normally releases. With the controller gone, a delete can wait forever; this one went through.
Code
ingressclass.networking.k8s.io "traefik" deleted
gatewayclass.gateway.networking.k8s.io "traefik" deleted
clusterrole.rbac.authorization.k8s.io "traefik-traefik" deleted
clusterrolebinding.rbac.authorization.k8s.io "traefik-traefik" deleted

The last command listed 25 CRDs from the chart (ingressroutes.traefik.io, middlewares.traefik.io and others). Helm never deletes CRDs from a chart's crds/ folder, not even with helm uninstall, because deleting a CRD deletes every object of that kind in the cluster. With none in use, they can go:

(cp1)

BASH
kubectl get crd -o name | grep traefik.io | xargs kubectl delete
k get crd | grep -c traefik

grep -c counts matching lines instead of printing them: 0 means they're gone. The Gateway API CRDs stay. With no controller, they're harmless.

In real life

  • ingress-nginx was retired in March 2026. Clusters still running it get no security fixes, and moving off it is a real project, because its many custom annotations don't carry over to other controllers.
  • New setups mostly choose the Gateway API. Ingress still works and isn't going away, but its features stopped growing, and the Gateway API has the ones teams used to add through annotations, such as header matching and traffic splitting.
  • The split is the point: a platform team owns the Gateway and its certificates, and app teams attach their own HTTPRoutes, within what allowedRoutes permits.
  • Pin chart versions, and keep values in a file (-f values.yaml) that lives in Git, rather than a row of --set flags.

Spot the problem

Work out what's wrong before you read the explanation.

"The Ingress is created, but nothing answers." k describe ingress shows the right backends with pod IPs, Ingress Class: <none>, and no events. Every request gets a connection refused or a 404 from the wrong place. What's missing? A controller that handles this Ingress. Check k get ingressclass: if there's none, a controller needs installing; if there is one, set it with ingressClassName in the Ingress.

"We installed a new controller, and only our new Ingresses work." The controller's IngressClass is marked default, yet Ingresses from last month still do nothing. Why? A default class is filled in when an Ingress is created, never afterwards. The old Ingresses have no class. Add ingressClassName to each, and they'll be picked up.

"Our HTTPRoute returns 404, but the Service is fine." An app team's route points at the platform team's Gateway in namespace infra. describe shows Accepted: False, reason NotAllowedByListeners. What do they change? Nothing on their side. The Gateway's listener only allows routes from its own namespace. The platform team sets its allowedRoutes to allow the app's namespace.

Keep this

ToUse
List Ingress controllersk get ingressclass
Make an Ingressk create ingress NAME -n NS --class=CLASS --rule="HOST/*=SVC:PORT"
A path and everything under itHOST/PATH* in --rule; PathPrefix in an HTTPRoute
Check the Gateway API is installedk get crd | grep gateway, then k get gatewayclass
Find Gatewaysk get gateway -A
Why a route failsk describe httproute NAME -n NS: Accepted, ResolvedRefs
Who may attach to a GatewayThe listener's allowedRoutes.namespaces.from
Test a host with no DNScurl -s -H "Host: NAME" http://NODE-IP:PORT/
Status code onlycurl -s -o /dev/null -w "%{http_code}\n" URL
A chart's real keyshelm show values REPO/CHART --version V
Remove a releasehelm uninstall first, then k delete ns

Where you are now

You've watched an Ingress do nothing without a controller, then installed the Gateway API's CRDs and one controller that serves both. You can route by host and path with an Ingress or an HTTPRoute, read the Accepted and ResolvedRefs conditions, and tell a refused route from a broken backend by its status code. You've also caught Helm ignoring a value, and learned why a release comes out before its namespace. That completes the Services and networking domain. Lesson 10 moves to workloads and scheduling.

Check yourself

  1. An Ingress shows the right backends with pod IPs in describe, but Ingress Class is none and Events is empty. Requests don't reach the app. What's the most likely cause?

  2. kubectl get gatewayclass says: the server doesn't have a resource type gatewayclass. What does that tell you?

  3. A new controller's IngressClass is marked default. Ingresses created yesterday, with no class, still aren't served. Why?

  4. An HTTPRoute returns 500. Its status shows Accepted True and ResolvedRefs False. Where do you look?

  5. An HTTPRoute in namespace shop attaches to a Gateway in namespace infra and gets Accepted False, NotAllowedByListeners. What fixes it?

  6. helm install ... --set service.type=NodePort succeeds, but the Service comes out as LoadBalancer. What happened?

Key terms

  • Ingress: rules that route outside web traffic to Services by host name and path.
  • Ingress controller: the program that reads Ingresses and does the routing. None comes with Kubernetes.
  • IngressClass: names a controller. An Ingress picks one with ingressClassName, or gets the default at creation.
  • CRD (CustomResourceDefinition): adds a new kind of object to the API. On its own, the object does nothing.
  • Controller: a program that watches objects and makes reality match them, in a loop.
  • Gateway API: the newer set of routing objects, installed as CRDs: GatewayClass, Gateway, HTTPRoute and others.
  • GatewayClass / Gateway / HTTPRoute: the controller, the entry point with its listeners, and the routing rules that attach to it.
  • Listener: a port and protocol a Gateway accepts, with allowedRoutes deciding which namespaces may attach.
  • Conditions: status fields such as Accepted, ResolvedRefs and Programmed that report whether an object works, and why not.
  • Finalizer: a hold on an object that blocks its deletion until a controller releases it.

Go deeper