Listener Configuration
Gateway definitions set up the protocols and ports on which Gloo Gateway listens for traffic. For example, by default Gloo Gateway will have a gateway configured for HTTP and HTTPS traffic. Gloo Gateway allows you to configure properties of your gateways with several plugins.
These guides show you how to apply these advanced listener configurations to refine your gateways' behavior.
Overview
For demonstration purposes, let’s edit the default gateways that are installed with glooctl install gateway. You can list and edit gateways with kubectl.
kubectl get gateway --all-namespaces
NAMESPACE NAME AGE
gloo-system gateway-proxy 2d
gloo-system gateway-proxy-ssl 2d
kubectl edit gateway -n gloo-system gateway-proxy
Plugin summary
The listener plugin portion of the gateway Custom Resource (CR) is shown below.
apiVersion: gateway.solo.io/v1
kind: Gateway
metadata: # collapsed for brevity
spec:
bindAddress: '::'
bindPort: 8080
httpGateway:
options:
grpcWeb:
disable: true
httpConnectionManagerSettings:
via: reference-string
useProxyProto: false
status: # collapsed for brevityVerify your configuration
To verify that your configuration was accepted, inspect the proxy.
glooctl get proxy -n gloo-system gateway-proxy -o yaml
...
spec:
listeners:
- bindAddress: '::'
bindPort: 8080
httpListener:
options:
grpcWeb:
disable: true
httpConnectionManagerSettings:
via: reference-string
virtualHosts:
- domains:
- '*'
name: gloo-system.merged-*
- domains:
- solo.io
name: gloo-system.myvs3
name: listener-::-8080
useProxyProto: false
- bindAddress: '::'
bindPort: 8443
httpListener: {}
name: listener-::-8443
useProxyProto: false
status: # collapsed for brevity
kind: List
metadata: # collapsed for brevityIPv4-only environments
By default, Gloo Gateway binds listeners to the IPv6 wildcard address ::, which listens for traffic on all interfaces. In IPv4-only Kubernetes environments, this causes gateways to fail to bind and proxies to receive an invalid xDS fallback configuration. Use the gatewayProxies.<NAME>.gatewaySettings.ipv4Only Helm value to switch the Gateway spec’s bindAddress to 0.0.0.0 instead.
-
Get the current Helm values for your installation and save them to a file.
helm get values gloo -n gloo-system -o yaml > gloo-gateway.yaml open gloo-gateway.yaml -
Add the following value to your Helm values file. Replace
<NAME>with the name of your gateway proxy, such asgatewayProxy.gatewayProxies: <NAME>: gatewaySettings: ipv4Only: true -
Upgrade your Gloo Gateway installation with the updated values.
helm upgrade -n gloo-system gloo gloo/gloo \ -f gloo-gateway.yaml
Next Steps
The guide above showed some basics on how to manipulate settings for the gateway listener in Gloo Gateway. The following guides provide additional detail around what you may want to change in the gateway CR and how to do so.
-
HTTP Connection Manager: Refine the behavior of Envoy for each listener that you manage with Gloo Gateway
-
Hybrid Gateway: Define multiple HTTP or TCP Gateways within a single Gateway
-
gRPC Web: Enable or disable the transcoding of messages to support gRPC web clients
-
TCP Proxy: Learn how to use Gloo Gateway as a simple TCP proxy
-
Websockets: Learn how to configure Websockets support in Gloo Gateway
-
Response caching: Learn how to configure response caching for upstream services in your cluster.
-
Traffic tapping: Copy contents of HTTP requests and responses to an external tap server.