Environment Variables
The Environment Variables section is essential for configuring the Lunar.dev API Consumption Gateway. These variables allow you to define key settings such as port configurations, logging levels, and tenant information, tailoring the gateway to meet your deployment needs.
Variable | K8S Variable | Description | Required? | Default Value | Possible Values |
---|---|---|---|---|---|
LUNAR_API_KEY | lunarAPIKey | Allow the Gateway to communicate with the Control Plane | No | -- | |
TENANT_NAME | tenantName | Configure the name for your organization | Yes | -- | The name of your organization, e.g. Acme , Google |
BIND_PORT | service.port | Configure the bind port Lunar.dev API Consumption Gateway listens on | No | 8000 | Any accessible port |
ENGINE_ADMIN_PORT | service.adminPort | Configure the admin port Lunar.dev API Consumption Gateway listens on. Also responsible for the Interceptor handshake | No | 8081 | Any accessible port |
LUNAR_HEALTHCHECK_PORT | service.healthCheckPort | Configure the port Lunar.dev API Consumption Gateway listens on | No | 8040 | Any accessible port |
LOG_LEVEL | logLevel | Configure the log level | No | ERROR | DEBUG , INFO , WARN , ERROR |
ENV | env | To set the environments stage | No | prod | prod , dev |
LUNAR_TELEMETRY | telemetryEnabled | Allow the user to disable telemetry report | No | true | true , false |
LUNAR_ACCESS_LOGS_OUTPUT | - | Enable the output for access logs into the stdout | No | stdout | stdout , NULL |
TLS_CERT_PATH | - | Point to the mounted certificate file, for TLS communication | No | /etc/lunar-proxy/certs/gateway_cert.pem | Path to the Relevant Certificate Path |
REDIS_URL | - | Path to the Redis Instance that’s connected to the Lunar.dev Gateway Pro Instances | No | — | Any URL |
REDIS_PREFIX | - | Prefix for Redis keys | No | lunar | Prefix for Redis keys |
REDIS_USE_CLUSTER | - | Enable the use of Redis Cluster | No | false | true , false |
REDIS_USE_CA_CERT | - | Enable the use of CA certificate for Redis mTLS connection | No | false | true , false |
REDIS_CA_CERT_PATH | - | Path to the CA certificate file for Redis mTLS connection | No | /etc/redis/ca.crt | Path to the CA certificate file |
REDIS_USE_CLIENT_CERT | - | Enable the use of client certificate for Redis mTLS connection | No | false | true , false |
REDIS_CLIENT_CERT_PATH | - | Path to the client certificate file for Redis mTLS connection | No | /etc/redis/client.crt | Path to the client certificate file |
REDIS_CLIENT_KEY_PATH | - | Path to the client key file for Redis mTLS connection | No | /etc/redis/client.key | Path to the client key file |
note
- Make sure the port you choose is accessible by the Lunar.dev Interceptor.
- By default, the main port is set to
8000
. - The handshake process uses port
8081
by default. - If you change
ENGINE_ADMIN_PORT
, remember to also update the Interceptor’sLUNAR_HANDSHAKE_PORT
accordingly. - Similarly, if you change
BIND_PORT
, be sure to update the Interceptor’sLUNAR_PROXY_HOST
to match.
Configuration Examples
- Docker
- K8S
- Local
docker run -d --rm -e TENANT_NAME="Acme Corp." -e LOG_LEVEL=DEBUG -e BIND_PORT=8000 -e ENGINE_ADMIN_PORT=8081 -e LUNAR_HEALTHCHECK_PORT=8040 -p 8000:8000 -p 8081:8081 -p 8040:8040 --name lunar-proxy lunarapi/lunar-proxy:latest
helm install lunar-proxy lunar/lunar-proxy --set service.port=8000 --set service.adminPort=8081 --set service.healthCheckPort=8040 --set logLevel=DEBUG --set tenantName="Acme Corp."
export BIND_PORT="8000"
export ENGINE_ADMIN_PORT="8081"
export LUNAR_HEALTHCHECK_PORT="8040"
export LOG_LEVEL="DEBUG"
export TENANT_NAME="Acme Corp."