Configuring Envoy

After installing Envoy, the next step is to configure it to work with your Deephaven instance. This configuration enables Envoy to act as a secure and robust front proxy, intelligently routing incoming traffic to the appropriate backend Deephaven services.

Deephaven simplifies this process by integrating with Envoy's dynamic configuration APIs (known as xDS). This allows Deephaven to automatically publish its service locations and routing rules to Envoy, minimizing the need for manual updates.

This guide covers two methods for setting up this integration:

  • Automatic: The recommended method for most users. Deephaven manages the Envoy configuration for you.
  • Manual: For users who require a customized setup or are integrating Envoy into an existing infrastructure.

Select a tab below based on your needs.

When configuring Envoy automatically, the installer sets the necessary properties in the iris-endpoints.prop file and adjusts the Envoy settings in getdown.global to direct the Client Update Service to use Envoy. Additionally, the installer generates an Envoy configuration YAML file, named envoy3.yaml, and copies it to the Deephaven node where Envoy is installed.

This method is primarily addressed in the Deephaven installation documentation, specifically in the Installation and Upgrade Guide and in the cluster configuration documentation under the section titled DH_CONFIGURE_ENVOY.

Tip

If Envoy is running on a separate system, the file copy step can be disabled by setting DH_ENVOY_COPY_YAML=false in the cluster.cnf file. An alternate location for Envoy can be specified by setting the DH_ENVOY_FQDN property in cluster.cnf.tip

Manual configuration requires two main steps: creating an Envoy configuration file and updating several Deephaven property files to ensure all services can communicate through the proxy.

Step 1: Create the Envoy Configuration File

Create an Envoy YAML file named envoy3.yaml and place it in /etc/sysconfig/illumon.d/resources. An example Envoy configuration is provided below.

Envoy Configuration File

Static resources

  • Clusters: In the static_resources section, configure the target address and port on which the Configuration Service listens for xDS requests. If the Configuration Service is on a different node than Envoy, or if Envoy is in a Docker container, change this to the appropriate address. The port must match the Deephaven system property envoy.xds.port, which defaults to 8124.

  • Listeners: The listeners section tells Envoy what addresses and ports to listen on for forwarding. In the example, 0.0.0.0 and port 8000 tell Envoy to listen for connections from any interface on port 8000.

TLS Certificates

When using TLS, Envoy needs access to the TLS Certificate chain and private key file. This is configured in the common_tls_context stanza. The example uses Deephaven’s default SSL files, but administrators should install their own for production.

Administration Interface

Administrators can set up the Envoy administration port to inspect the running configuration. The example enables this on port 8001. Be careful with this in production, as it allows access to internal Envoy configuration.

Step 2: Configure Deephaven Services

This step requires additions to Deephaven properties in iris-environment.prop, iris-endpoints.prop, and getdown.global.

Note

Once Envoy is enabled for Deephaven, all services must be configured to use it, or the Configuration Server service will fail to start.

Update iris-environment.prop

Export, edit, and reimport this file:

Add the following properties:

Update iris-endpoints.prop

Services like the Persistent Query Controller need to know about all dispatchers. Add configuration_server to the iris_controller stanza and define the websocket ports for merge servers.

Export, edit, and reimport the file:

Example for a three-node cluster:

Note

The iris-endpoints.prop file is regenerated by the Deephaven installer. After any reconfiguration or upgrade, you must reapply these modifications.

Update getdown.global

Update /etc/sysconfig/illumon.d/getdown.global to tell the Web UI where to find the server:

Update /etc/sysconfig/illumon.d/client_update_service/getdown.global so the Swing client reads properties from disk:

Step 3: Advanced Configuration (Optional)

Custom HTTP Headers

You can add custom HTTP headers to responses from the Deephaven server. Deephaven has pre-defined headers (e.g., Strict-Transport-Security, X-Frame-Options) that can be enabled in iris-environment.prop:

You can also add custom headers not pre-defined in iris-defaults.prop. For each header, create a pair of properties to enable it and set its value:

Extra XDS Routes

Additional routes can be added to the Envoy configuration to expose other services. For each route, create a set of properties in iris-environment.prop:

WebSocket Message Size

If you encounter errors that a WebSocket message size exceeds the maximum, you can increase the limit with the following property in iris-environment.prop:

Step 4: Restart Services

After making these changes, restart all services on all nodes for them to take effect:

Configuration properties

The following table summarizes the key properties used when manually configuring Deephaven to work with Envoy.

PropertyFile(s)Description
global.websocket.server.enablediris-environment.propEnables the WebSocket server required for proxying.
envoy.front.proxy.urliris-environment.propThe public-facing URL of the Envoy proxy.
envoy.terminate.ssliris-environment.propInforms Deephaven that Envoy is handling TLS termination.
Webapi.server.hostiris-environment.propSpecifies the host of the Web API server for the Configuration Server.
global.websocket.client.enablediris-environment.propEnables the WebSocket client for Swing applications.
authentication.server.listiris-environment.propPoints Swing clients to Envoy for authentication.
opt=-Ddeephaven.web.client.publicUrlgetdown.globalSets the public URL for the Web UI client to connect to the server.
jvmarggetdown.globalForces the Swing client to use local property files.
websocket.client.max.message.sizeiris-environment.propIncreases the maximum WebSocket message size to prevent errors.
envoy.add.header.*iris-environment.propEnables and sets custom HTTP headers in responses.
envoy.xds.extra.routes.*iris-environment.propDefines additional routes for exposing other services through Envoy.

Security Considerations

When deploying Envoy in a production environment, it is critical to consider the following security best practices:

  • TLS Certificates: The example configuration uses Deephaven’s default lighttpd.pem file for convenience. For any production system, you should replace this with your own properly signed TLS certificate and private key to ensure secure communication.

  • Admin Interface: The Envoy admin interface on port 8001 provides powerful debugging capabilities but also exposes sensitive configuration details. In a production environment, access to this port should be heavily restricted. Use firewall rules (e.g., iptables or your cloud provider's security groups) to ensure that the admin port is only accessible from trusted IP addresses, such as a specific bastion host or an internal management network.

  • Network Security: Ensure that the network communication between Envoy and the backend Deephaven services is secure. If Envoy and Deephaven are running on different hosts, consider using a private network or firewall rules to limit traffic between them to only the necessary ports.