Getting started Community Training Tutorials Documentation APIs, AI & Tools
docker run --rm \
-v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \
-p 8080:8080 \
-e FLEX_SYNC_DEBOUNCE_TIME=10s \
mulesoft/flex-gateway
Omni Gateway provides these environment variables to configure your gateway:
| Variable Name | Default Value | Description |
|---|---|---|
FLEX_CONNECTION_IDLE_TIMEOUT_SECONDS |
|
Maximum number of seconds a connection can be idle before it times out. For more information, see Configuring Timeouts in Local Mode. |
FLEX_STREAM_IDLE_TIMEOUT_SECONDS |
|
Maximum number of seconds a stream can remain idle without receiving any data in either the inbound (client to Omni Gateway) or outbound (Omni Gateway to upstream service) direction. For more information, see Configuring Timeouts in Local Mode. |
FLEX_UPSTREAM_CONNECTION_IDLE_TIMEOUT_SECONDS |
|
Maximum number of seconds a stream between Omni Gateway and the upstream service can remain idle between requests. For more information, see Configuring Timeouts in Local Mode. |
FLEX_UPSTREAM_RESPONSE_TIMEOUT_SECONDS |
|
Maximum number of seconds an Omni Gateway waits for a response from an upstream service. For more information, see Configuring Timeouts in Local Mode. |
FLEX_ENVOY_HEADERS_ENABLED |
|
Allows ( |
FLEX_REWRITE_HOST_HEADER |
|
Rewrite HTTP Host header to match upstream. |
FLEX_BASE_PATH_CANONICALIZER_ENABLED |
|
Internally rewrites requests that exactly match a slashless API base path, such as |
FLEX_REMOVE_SERVER_HEADER |
|
Removes the |
FLEX_HEADER_RAW_VALUE_ENABLE |
`tru`e |
Controls header encoding for external authorization. Set to |
FLEX_FORWARD_CLIENT_CERT_DETAILS |
|
Controls how the |
FLEX_DOWNSTREAM_CONNECTION_BUFFER_LIMIT_BYTES |
|
Maximum size, in bytes, of read and write buffers for new connections. For more information, see Requirements and Limits for Omni Gateway. |
FLEX_DATASOURCE_CONTROL_NODE_ENABLED |
|
Enable configuration caching in Redis shared storage for Connected Mode replicas. This variable is enabled by default. To disable configuration caching, set this variable to |
FLEX_CONTROL_NODE_STORAGE_ENCRYPTION_ENABLED |
|
Encrypts the configuration data that configuration caching stores. To disable encryption, set this variable to |
FLEX_STORAGE_ENCRYPTION_KEY |
N/A |
A base64-encoded PEM private key that encrypts the configuration data that configuration caching stores. If not set, Omni Gateway derives the encryption key from the registration private key. For more information, see conn-replica-caching.adoc#encryption. |
FLEX_SERVICE_ENVOY_DRAIN_TIME |
|
Drain period in seconds during shutdown before Omni Gateway exits gracefully. For more information, see Monitoring in Local Mode. |
FLEX_SYNC_DEBOUNCE_TIME |
"5s" |
Specifies the amount of time to wait after detecting a configuration change before applying it. This prevents excessive reloading during rapid successive changes. The value must be a valid duration string, such as |
FLEX_DNS_REFRESH_RATE |
|
Sets how often Omni Gateway refreshes DNS for upstream service clusters. The value is a duration string that is clamped between |
FLEX_LOG_LEVEL |
|
Sets the logging level for Omni Gateway. For the environment variable configuration of log level, you specify a number that corresponds to the log level. Supported values are NONE:`-1`, FATAL:`0`, ERROR:`1`, WARN:`2`, INFO:`4`, DEBUG:`8`, and TRACE:`16`. |
FLEX_CONFIG |
N/A |
Provides Omni Gateway registration and configuration as a YAML-formatted string. The YAML content must be properly escaped to preserve special characters. Provide your registration and configuration as a string if deploying environments where file mounting isn’t practical, such as Amazon ECS or Azure Container Apps. |
How you set an environment variable depends on where Omni Gateway runs. The examples in this section set the debounce time variables, but you can use the same approach for any variable in the previous table.
Omni Gateway reads environment variables only when it starts. After you set a variable, restart Omni Gateway to apply the change.
Pass each variable with the -e option in the docker run start command, for example:
docker run --rm \
-v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \
-p 8080:8080 \
-e FLEX_SYNC_DEBOUNCE_TIME=10s \
mulesoft/flex-gateway
Podman uses the same -e option in the podman run start command.
If you use Docker Compose, add the variables to the environment section of the service, for example:
services:
flex-gateway:
image: mulesoft/flex-gateway
environment:
FLEX_SYNC_DEBOUNCE_TIME: "10s"
When Omni Gateway runs as a Linux service, systemd sets its environment variables. Add the variables in a drop-in file for the flex-gateway service:
Create a drop-in file named env.conf in the /etc/systemd/system/flex-gateway.service.d/ directory:
sudo mkdir -p /etc/systemd/system/flex-gateway.service.d
sudo tee /etc/systemd/system/flex-gateway.service.d/env.conf > /dev/null <<'EOF'
[Service]
Environment=FLEX_SYNC_DEBOUNCE_TIME=10s
EOF
Don’t edit the override.conf file in the same directory. The Omni Gateway package installs and manages that file.
Reload the systemd configuration and restart Omni Gateway:
sudo systemctl daemon-reload
sudo systemctl restart flex-gateway
Verify that the service includes the new variables:
systemctl show flex-gateway --property=Environment
When you deploy Omni Gateway with the Helm chart, the chart sets the environment variables on the Omni Gateway pod. Set the debounce times with these Helm chart values:
| Helm Chart Value | Environment Variable |
|---|---|
|
|
Don’t use extraEnvs to override a variable that the Helm chart already configures through a chart value. Set the Helm chart value directly instead.
To change the values on an existing deployment, run helm upgrade with the --set option, for example:
helm -n gateway upgrade ingress \
--wait \
--reuse-values \
flex-gateway/flex-gateway \
--set gateway.syncDebounceTime=10s
Alternatively, add the values to a configuration file that you pass with the -f option:
gateway:
syncDebounceTime: "10s"
To set a variable that doesn’t have a Helm chart value, use extraEnvs, for example:
extraEnvs:
- name: FLEX_REMOVE_SERVER_HEADER
value: "true"
For more information about updating Helm chart values, see Update Pod Settings for an Omni Gateway Deployment Through a Helm Chart.
Omni Gateway reads FLEX_* environment variables only when it starts. To verify the values the gateway is running with, run flexctl dump and open env/vars.json in the extracted ZIP file. For more information, see Troubleshooting with the CLI.
|