You are viewing the documentation for the 2.0.x version of Gloo Gateway. To get the latest enterprise features of the Kubernetes Gateway API on top of the kgateway project, see Solo Enterprise for kgateway. To use the older Gloo Gateway 1.x that is based on the Gloo upstream project, click here.
TLS passthrough
Set up a TLS listener on the Gateway that serves one or more hosts and passes TLS traffic through to a destination. Because TLS traffic is not terminated at the Gateway, the destination must be capable of handling incoming TLS traffic.
Make sure that you have the OpenSSL version of openssl, not LibreSSL. The openssl version must be at least 1.1.
Check the openssl version that is installed. If you see LibreSSL in the output, continue to the next step.
openssl version
Install the OpenSSL version (not LibreSSL). For example, you might use Homebrew.
brew install openssl
Review the output of the OpenSSL installation for the path of the binary file. You can choose to export the binary to your path, or call the entire path whenever the following steps use an openssl command.
For example, openssl might be installed along the following path: /usr/local/opt/openssl@3/bin/
To run commands, you can append the path so that your terminal uses this installed version of OpenSSL, and not the default LibreSSL. /usr/local/opt/openssl@3/bin/openssl req -new -newkey rsa:4096 -x509 -sha256 -days 3650...
Decide whether to set up a listener inline on the Gateway resource or as a separate ListenerSet resource. For more information, see the Listener overview.
ListenerSets: This feature is available with Gloo Gateway 2.x or later. You must install the experimental channel of the Kubernetes Gateway API at version 1.3 or later.
Deploy an nginx server that is configured for HTTPS traffic link
Deploy a sample nginx server and configure the server for HTTPS traffic.
Create a root certificate for the example.com domain. You use this certificate to sign the certificate for your nginx service later.
To route TLS traffic to the nginx server directly without terminating the TLS connection at the Gateway, you can use either an inline Gateway listener or a ListenerSet. Then, you create a TLSRoute that represents the route to your nginx server and attach it to the Gateway or ListenerSet.
If you plan to set up your listener as part of a ListenerSet, keep the following considerations in mind. For more information, see ListenerSets (experimental).
This feature is available with Gloo Gateway 2.x or later.
You must install the experimental channel of the Kubernetes Gateway API at version 1.3 or later.
Create a Gateway that passes through incoming TLS requests for the nginx.example.com domain.
Review the following table to understand this configuration.
Setting
Description
spec.gatewayClassName
The name of the Kubernetes GatewayClass that you want to use to configure the Gateway. When you set up Gloo Gateway, a default GatewayClass is set up for you. To use the default Envoy-based Gloo Gateway proxy, set the gatewayClassName to gloo-gateway-v2. To use agentgateway, set the gatewayClassName to agentgateway.
spec.listeners
Configure the listeners for this Gateway. In this example, you configure a TLS passthrough Gateway that listens for incoming traffic for the nginx.example.com domain on port 8443. The Gateway can serve TLS routes from any namespace.
spec.listeners.tls.mode
The TLS mode for incoming requests. In this example, TLS requests are passed through to the backend service without being terminated at the Gateway.
Create a Gateway that enables the attachment of ListenerSets.
Review the following table to understand this configuration.
Setting
Description
spec.gatewayClassName
The name of the Kubernetes GatewayClass that you want to use to configure the Gateway. When you set up Gloo Gateway, a default GatewayClass is set up for you. To use the default Envoy-based Gloo Gateway proxy, set the gatewayClassName to gloo-gateway-v2. To use agentgateway, set the gatewayClassName to agentgateway.
spec.allowedListeners
Enable the attachment of ListenerSets to this Gateway. The example allows listeners from any namespace.
spec.listeners
Optionally, you can configure a listener that is specific to the Gateway. Note that due to a Gateway API limitation, you must configure at least one listener on the Gateway resource, even if the listener is not used and is a generic, “dummy” listener. This generic listener cannot conflict with the listener that you configure in the ListenerSet, such as using the same port or name. In this example, the generic listener is configured on port 80, which differs from port 443 in the ListenerSet that you create later.
Create a ListenerSet that configures a TLS passthrough listener for the Gateway.
Get the external address of the gateway proxy and save it in an environment variable.external address of the gateway proxy and save it in an environment variable.
Send a request to the nginx.example.com domain and verify that you get back a 200 HTTP response code from your nginx server. Because nginx accepts incoming TLS traffic only, the 200 HTTP response code proves that TLS traffic was not terminated at the Gateway. In addition, you can verify that you get back the server certificate that you configured your nginx server with in the beginning.
* Request completely sent off
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx/1.27.4
Server: nginx/1.27.4
...
<
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
* Connection #0 to host nginx.example.com left intact
Port-forward the tls-passthrough gateway proxy pod on port 8443.
Send a request to the nginx.example.com domain and verify that you get back a 200 HTTP response code from your nginx server. Because nginx accepts incoming TLS traffic only, the 200 HTTP response code proves that TLS traffic was not terminated at the Gateway. In addition, you can verify that you get back the server certificate that you configured your nginx server with in the beginning.
* Request completely sent off
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx/1.27.4
Server: nginx/1.27.4
...
<
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
* Connection #0 to host nginx.example.com left intact