Skip to main content
Quick navigation

Environment Variables

Configuring the environment variables is the recommended way of setting up Conduktor Gateway.

Jump to:

Kafka Environment Variables

Conduktor Gateway connections to Kafka are configured by prefixed and translated environment variables. Any variable prefixed with KAFKA_ will be treated as a connection parameter. The remainder of the environment variable will be lower cased and have _ replaced with ..

Thus a variable

KAFKA_BOOTSTRAP_SERVERS

is equivalent to the Kafka property;

bootstrap.servers

Gateway Environment Variables

Default configurations for Conduktor Gateway can be overridden by environment variables:

Guidelines

A typical deployment of Gateway is hard to describe as every environment will be unique in it's design and considerations.

As such, the below is an example including some variables we recommend you modify in any setup you do, but is by no means a guarantee of sufficient requirements in your setup.

We will support you in onboarding of Conduktor Gateway to help you get setup in the first place and for any ongoing issues or questions please contact support at support@conduktor.io.

Example Values

  -e KAFKA_BOOTSTRAP_SERVERS=kafka1:9092,kafka2:9092 \
-e KAFKA_SASL_MECHANISM=PLAIN \
-e KAFKA_SECURITY_PROTOCOL=SASL_PLAINTEXT \
-e KAFKA_SASL_JAAS_CONFIG="org.apache.kafka.common.security.plain.PlainLoginModule required username='usr' password='pwd';"

Host/Port

Environment VariableDefault ValueDescription
GATEWAY_BIND_HOST0.0.0.0The host on which to bind the gateway
GATEWAY_ADVERTISED_HOSTdefaults to your hostnameThe gateway hostname that should be presented to clients
GATEWAY_PORT_START6969Port on which Gateway will start listening on
GATEWAY_PORT_COUNTdefaults to your number of brokers +2Number of ports to be used by the Gateway, each port will correspond to a broker in the Kafka cluster so it must be at least as large as the broker count of the Kafka cluster. In production, we recommend it is double the size of the Kafka cluster to allow for expansion and reassignment.

Load Balancing

Environment VariableDefault ValueDescription
GATEWAY_CLUSTER_IDconduktorGatewayA unique identifier for a given Gateway cluster, this is used to establish Gateway cluster membership for load balancing
GATEWAY_FEATURE_FLAGS_INTERNAL_LOAD_BALANCINGtrueWhether to use Conduktor Gateway's internal load balancer to balance connections between Gateway instances.
GATEWAY_RACK_IDnoneSimilar as broker.rack

Client to Gateway Authentication

Note: These configurations apply to authentication between clients and Conduktor Gateway. For authentication between Conduktor Gateway and Kafka see Kafka Environment Variables

Environment VariableDefault ValueDescription
GATEWAY_SECURITY_PROTOCOLdefaults to KAFKA_SECURITY_PROTOCOLThe type of authentication clients should use to connect to the gateway, valid values are PLAINTEXT, SASL_PLAIN and SASL_SSL

SSL

Environment VariableDefault ValueDescription
GATEWAY_SSL_KEY_STORE_PATHconfig/kafka-proxy.keystore.jksPath to a keystore for SSL connections
GATEWAY_SSL_KEY_STORE_PASSWORD123456Password for the keystore defined above
GATEWAY_SSL_KEY_PASSWORD123456Password for the key contained in the store above
GATEWAY_SSL_KEY_TYPEjksWe currently only support jks
GATEWAY_SSL_UPDATE_INTERVAL_MS600000
GATEWAY_SSL_UPDATE_CONTEXT_INTERVAL_MINUTES5Interval in minutes to refresh SSL context
Environment VariableDefault ValueDescription
GATEWAY_SSL_TRUST_STORE_PATHconfig/kafka-proxy.truststore.jksPath to a keystore for SSL connections
GATEWAY_SSL_TRUST_STORE_PASSWORD123456Password for the keystore defined above
GATEWAY_SSL_TRUST_STORE_TYPEjksWe currently only support jks
GATEWAY_SSL_CLIENT_AUTHNONENONE will not request client authentication, OPTIONAL will request client authentication, REQUIRE will require client authentication

SSL Config

Environment VariableDefault ValueDescription
GATEWAY_AUTHENTICATION_CONNECTION_MAX_REAUTH_MS0Max Reauth
GATEWAY_AUTHENTICATION_EXPONENTIAL_BACKOFF_MULTIPLIER2Backoff multiplier on reauth
GATEWAY_AUTHENTICATION_EXPONENTIAL_BACKOFF_MAX_MS5000Max backoff

SECURITY PROVIDER

Environment VariableDefault ValueDescription
GATEWAY_SECURITY_PROVIDERDEFAULTSpecify your security provider, can be DEFAULT (from your JRE), BOUNCY_CASTLE, BOUNCY_CASTLE_FIPS and CONSCRYPT

Please note that CONSCRYPT does not support Mac OS with aarch64

HTTP

Environment VariableDefault ValueDescription
GATEWAY_HTTP_PORT8888The port on which the gateway will present a HTTP management API
GATEWAY_SECURED_METRICStrueDoes the HTTP management API require users?
GATEWAY_ADMIN_API_USERS[{username: admin, password: conduktor, admin: true}]Users that can access the api, please note that admin is required to do any write

Internal state

Conduktor needs to save state, you can choose where:

Environment VariableDefault ValueDescription
GATEWAY_STORAGE_TYPEKAFKACan be IN_MEMORY, KAFKA and POSTGRES
GATEWAY_STORE_TTL_MS604800000Time between full refresh

Topics names

State is saved in different location based on GATEWAY_STORAGE_TYPE

When it is set

  • KAFKA they will be materialized as a topic.
  • POSTGRES they will be stored as a table.
  • IN_MEMORY they will be stored in memory.
Environment VariableDefault ValueDescription
GATEWAY_TOPIC_STORE_MAPPING_BACKING_TOPIC_topicMappingsName of topicMappings topic
GATEWAY_TOPIC_STORE_REGISTRY_BACKING_TOPIC_topicRegistryName of topicRegistry topic
GATEWAY_INTERCEPTOR_STORE_BACKING_TOPIC_interceptorConfigsName of interceptorConfigs topic
GATEWAY_ACLS_STORES_BACKING_TOPIC_aclsName of acls topic
GATEWAY_OFFSET_STORE_COMMITTED_OFFSET_BACKING_TOPIC_offsetStoreName of offsetStore topic
GATEWAY_OFFSET_STORE_CONSUMER_GROUP_SUBSCRIPTION_BACKING_TOPIC_consumerGroupSubscriptionBackingTopicName of consumerGroupSubscriptionBackingTopic topic
GATEWAY_LICENSE_BACKING_TOPIC_licenseName of license topic

IN_MEMORY State Configurations

none

KAFKA State Configurations

Environment VariableDefault ValueDescription
GATEWAY_TOPIC_STORE_REAL_TOPIC_PARTITION_COUNT-1Defaults to the one defined in your cluster settings
GATEWAY_TOPIC_STORE_KCACHE_REPLICATION_FACTOR-1Defaults to the one defined in your cluster settings
GATEWAY_TOPIC_STORE_DISTRIBUTED_CATCHUP_TIMEOUT_IN_SECONDS1Duration for catchup

POSTGRES State Configurations

Environment VariableDefault ValueDescription
GATEWAY_STORAGE_RDBMS_URLNonePostgresql Url
GATEWAY_STORAGE_RDBMS_USERNonePostgresql User
GATEWAY_STORAGE_RDBMS_PASSWORDNonePostgresql password
GATEWAY_STORAGE_RDBMS_SCHEMANonePostgresql Schema
GATEWAY_STORAGE_RDBMS_POLLINGINTERVAL500msRefresh interval in ms

Internal setup

Threading

Environment VariableDefault ValueDescription
GATEWAY_DOWNSTREAM_THREADnumber of coresThe number of threads dedicated to handling IO between clients and Conduktor Gateway
GATEWAY_UPSTREAM_THREADnumber of coresThe number of threads dedicated to handling IO between Kafka and Conduktor Gateway
GATEWAY_UPSTREAM_MAX_PENDING_TASK2048Maximum number of pending tasks to handling IO between Kafka and Conduktor Gateway

Upstream Connection

Environment VariableDefault ValueDescription
GATEWAY_UPSTREAM_NUM_CONNECTION10The number of connections between Conduktor Gateway and Kafka

Feature Flags

Environment VariableDefault ValueDescription
GATEWAY_FEATURE_FLAGS_MULTI_TENANCYfalseWhether or not to pass Kafka credentials from the client through to the cluster for connecting, or use the tenants within Gateway. This must be enabled for multi-tenancy.
GATEWAY_FEATURE_FLAGS_AUDITtrueWhether or not to enable the audit feature
GATEWAY_FEATURE_FLAGS_RBACfalseWhether or not to enable the RBAC feature
GATEWAY_FEATURE_FLAGS_SINGLE_TENANTfalseWhether or not to enable single tenant mode, in this mode topic names etc are not prefixed.
GATEWAY_FEATURE_FLAGS_INTERNAL_LOAD_BALANCINGtrueWhether or not to enable we replicate kafka internal load balancing

Licensing

Environment VariableDefault ValueDescription
GATEWAY_LICENSE_KEYNoneLicense key

Audit

Environment VariableDefault ValueDescription
GATEWAY_AUDIT_LOG_CONFIG_SPEC_VERSION0.1.0Version
GATEWAY_AUDIT_LOG_SERVICE_BACKING_TOPIC_auditLogsTarget topic name
GATEWAY_AUDIT_LOG_REPLICATION_FACTOR_OF_TOPIC-1Replication factor to be used when creating the audit topic, defaults to the one defined in your cluster settings
GATEWAY_AUDIT_LOG_NUM_PARTITIONS_OF_TOPIC-1Number of partitions to be used when creating the audit topic, defaults to the one defined in your cluster settings

Logging

Environment VariableDefault ValueDescription
LOG4J2_APPENDER_LAYOUTpatternThe format to output console logging. Use json for json layout or pattern for pattern layout
LOG4J2_ROOT_LEVELinfoThe logging level for the root logger
LOG4J2_ORG_APACHE_KAFKA_LEVELwarnThe logging level for the package org.apache.kafka
LOG4J2_IO_KCACHE_LEVELwarnThe logging level for the package io.kcache
LOG4J2_IO_VERTX_LEVELwarnThe logging level for the package io.vertx
LOG4J2_IO_NETTY_LEVELerrorThe logging level for the package io.netty
LOG4J2_IO_CONDUKTOR_LEVELinfoThe logging level for the package io.conduktor
LOG4J2_IO_CONDUKTOR_PROXY_AUTHORIZATION_LEVELinfoThe logging level for the package io.conduktor.proxy.authorization
LOG4J2_IO_CONDUKTOR_PROXY_REBUILDER_COMPONENTS_LEVELinfoThe logging level for the package io.conduktor.proxy.rebuilder.components
LOG4J2_IO_CONDUKTOR_PROXY_SERVICE_LEVELinfoThe logging level for the package io.conduktor.proxy.service
LOG4J2_IO_CONDUKTOR_PROXY_NETWORK_LEVELinfoThe logging level for the package io.conduktor.proxy.network
LOG4J2_IO_MICROMETER_LEVELerrorThe logging level for the package io.micrometer

Usage Analytics

Environment VariableDefault ValueDescription
GATEWAY_FEATURE_FLAGS_ANALYTICStrueConduktor collects basic user analytics to understand product usage and enable product development and improvement, such as a Gateway Started event. This is not based on any of the underlying Kafka data.