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 using Podman or Kubernetes, Envoy is configured automatically from the inputs you normally provide.

Note

The various DH_*ENVOY* cluster.cnf properties only apply to native installations of Deephaven. They are used to configure both Deephaven properties and Envoy YAML from a single source of truth (cluster.cnf).

Native installer Envoy properties

When using the native installer, Envoy-related settings are sourced from cluster.cnf and translated into generated configuration artifacts.

At a high level:

  • Deephaven service configuration is written into iris-endpoints.prop Deephaven properties file.
  • Envoy itself is configured via a generated /etc/sysconfig/illumon.d/resources/envoy3.yaml.
  • The legacy client URL and port are updated in /etc/sysconfig/illumon.d/client_update_service/getdown.global.

A variety of DH_*ENVOY* variables in cluster.cnf (plus the cluster topology / node roles) are used to control how Envoy is set up and run.

cluster.cnf propertyTarget file(s)Notes
DH_CONFIGURE_ENVOYiris-endpoints.propCauses the installer to update Deephaven properties to force clients to route through Envoy rather than connect directly to services.
DH_ENVOY_FQDN, DH_ENVOY_PORTgetdown.globalUsed to construct the client-facing host/port that clients use to reach Deephaven via Envoy.
DH_ENVOY_CLUSTER_TYPEenvoy3.yamlChooses how the generated Envoy configuration resolves the Configuration Server address; by default, STRICT_DNS is used.
DH_ENVOY_PORTenvoy3.yamlSets the port Envoy listens on for incoming client connections.
DH_ENVOY_ENABLE_ADMIN, DH_ENVOY_ADMIN_PORTenvoy3.yamlControls whether the Envoy admin interface is included in the generated config, and which port it uses when enabled.
DH_ENVOY_PEM_PATHenvoy3.yamlSets the filesystem path Envoy uses for its TLS certificate/key PEM bundle.
DH_ENVOY_LOCAL_CERTInstallation host filesystemControls where the installer finds the PEM to copy to the Envoy host.
DH_ENVOY_REMOTE_CERTEnvoy node filesystemControls where the installer places the PEM bundle on the Envoy host.

Instead of maintaining iris-endpoints.prop, getdown.global, or envoy3.yaml manually (and re-applying changes on every upgrade), set the Envoy-related cluster.cnf properties, place the required certificate files on the Installation host, and re-run the native installer scripts.

With this approach, upgrades and reconfiguration can safely regenerate the various property files and YAML to match your current cluster topology.

Manual Envoy configuration

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.

An example Envoy YAML is given below.

Manual Envoy YAML configuration

Create your own envoy.yaml

When manually configuring Envoy, the location of the envoy.yaml file matters only to the running Envoy process, which reads it when the proxy starts. The default location used by the Deephaven installer is /etc/sysconfig/illumon.d/resources/envoy3.yaml.

Caution

The native installer will automatically create the file /etc/sysconfig/illumon.d/resources/envoy3.yaml when DH_CONFIGURE_ENVOY=true. This file is altered to match the current network topology defined in cluster.cnf. If you make any changes to this file, those changes will be lost every time you upgrade Deephaven. You can disable this by setting DH_ENVOY_COPY_YAML=false, but you will be responsible for maintaining your Envoy configuration.

Whenever editing Envoy YAML, always consult the Envoy documentation.

A sample envoy.yaml file is given below.

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

Manually configured Envoy installations must supply TLS certificates in the same manner as automatic Envoy configuration.

Administration Interface

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

Configure Deephaven to route through Envoy

Altering how Deephaven routes client requests requires changes 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.

Tip

All customizations described below are done automatically with the native installer when DH_CONFIGURE_ENVOY=true.

Update iris-environment.prop

Export, edit, and reimport this file:

Add the following properties:

Take special note of the tls.truststore= section in the above YAML.

This value can vary depending on how your administrator configured TLS trust for your cluster, and should already be configured automatically.

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.

Warning

iris-endpoints.prop is regenerated and reimported automatically every time the native installer upgrades your system. The values below are automatically added, are rarely changed, and will be overwritten on every upgrade. If there is a value that you want to change which is overwritten by values from cluster.cnf, instead edit your cluster.cnf so the installation process is aware of your changes.

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 any 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:

Note

The changes to getdown.global are done automatically when using the Deephaven installer. The Deephaven-supplied getdown.txt.pre contains the token #<Envoy properties loader property> which is automatically translated into the appropriate jvmarg. If you make any customizations to property loading, you may need to reapply your changes after every upgrade.

Envoy YAML file

An example Envoy configuration YAML file is provided below.

Envoy Configuration File

Whenever you change the contents of envoy.yaml, you must notify the Envoy process for the changes to take effect.

The Envoy troubleshooting guide contains additional advice on how to configure Envoy application log levels, increase Envoy request logging, and more.

Envoy ports

Using Envoy as a reverse proxy allows you to isolate all internal network traffic behind one or two ports.

The exposed Envoy port is where all Deephaven client TLS connections will be made.

In addition to the main Envoy port, when you need to debug your Envoy installation, you may need to expose the Envoy admin interface as well.

Because the admin interface exposes sensitive information and can modify your cluster's runtime behavior, you should be careful to expose this port to the narrowest possible audience. For example, using the admin interface using curl from the Envoy host machine means you do not need to expose the admin port to the network interfaces that Deephaven clients can reach.

Advanced Envoy configuration

In case you have additional needs for Envoy to function in your network, there are a variety of Deephaven properties that can be set to control the inner workings of the reverse proxy.

Any additional configuration needed for your networks should be well documented and stored in source control, so any customizations can be maintained as your network or needs change.

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 that are not predefined 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:

Restart services after any configuration change

After making changes to Deephaven properties, those properties are cached by running processes, so it is the most reliable to restart all services on all nodes after any changes:

If you need to perform selective service restarts in a production environment, consult a Deephaven representative about your specific use case.

Restarting Envoy is covered in the Envoy troubleshooting guide.

Envoy configuration properties

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

These properties are all set automatically when using the native installer with DH_CONFIGURE_ENVOY=true.

PropertyFile(s)Description
global.websocket.server.enablediris-endpoints.propEnables the WebSocket server required for proxying.
envoy.front.proxy.urliris-endpoints.propThe public-facing URL of the Envoy proxy.
Webapi.server.hostiris-endpoints.propSpecifies the host of the Web API server for the Configuration Server.
global.websocket.client.enablediris-endpoints.propEnables the WebSocket client for Swing applications.
authentication.server.listiris-endpoints.propPoints Swing clients to Envoy for authentication.
appbasegetdown.globalConfigure the base URL Swing and legacy enterprise clients use to connect to Deephaven.
websocket.client.max.message.sizeiris-endpoints.propIncreases the maximum WebSocket message size to prevent errors.
envoy.add.header.*iris-endpoints.propEnables and sets custom HTTP headers in responses.
envoy.xds.extra.routes.*iris-endpoints.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 "a file mounted at /envoy.pem" for convenience. Your actual certificate must meet the TLS certificate requirements.

  • 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 the admin port is accessible only 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.