HTTP
Set up an HTTP listener on your API gateway.
Before you begin
Decide whether to set up an HTTP listener inline on the Gateway resource or as a separate ListenerSet resource. Note that ListenerSets are an experimental feature in the upstream Kubernetes Gateway API project, and subject to change. For more information, see the Listener overview.
If you followed the Get started guide, you already have a gateway named
httpin thegloo-systemnamespace of your cluster. This gateway can be used as the main ingress for the apps in your cluster. ListenerSets and HTTPRoutes can refer to this gateway independent of the namespace they are in. However, you can also use the steps in this guide to create more gateways, such as to support different deployment patterns.
Set up an HTTP listener
Create a Gateway resource with an HTTP listener.
Check the status of the Gateway to make sure that your configuration is accepted and no conflicts exist in your cluster.
kubectl get gateway my-http-gateway -n gloo-system -o yamlCreate an HTTPRoute resource for the httpbin app that is served by the gateway that you created.
Verify that the HTTPRoute is applied successfully.
kubectl get httproute/httpbin-mydomain -n httpbin -o yamlExample output: Notice in the
statussection that the parentRef is either the Gateway or the ListenerSet, depending on how you attached the HTTPRoute.... status: parents: - conditions: - lastTransitionTime: "2025-04-29T20:48:51Z" message: "" observedGeneration: 3 reason: Accepted status: "True" type: Accepted - lastTransitionTime: "2025-04-29T20:48:51Z" message: "" observedGeneration: 3 reason: ResolvedRefs status: "True" type: ResolvedRefs controllerName: solo.io/gloo-gateway parentRef: group: gateway.networking.x-k8s.io kind: XListenerSet name: my-http-listenerset namespace: httpbinVerify that the listener now has a route attached.
Get the external address of the gateway and save it in an environment variable.
Send a request to the httpbin app and verify that you get back a 200 HTTP response code.
Example output:
* Mark bundle as not supporting multiuse < HTTP/1.1 200 OK HTTP/1.1 200 OK < access-control-allow-credentials: true access-control-allow-credentials: true < access-control-allow-origin: * access-control-allow-origin: * < date: Fri, 03 Nov 2023 20:02:48 GMT date: Fri, 03 Nov 2023 20:02:48 GMT < content-length: 0 content-length: 0 < x-envoy-upstream-service-time: 1 x-envoy-upstream-service-time: 1 < server: envoy server: envoy