Configuration
Contents
Rest Proxy Configuration
The default values for Rest proxy are in platform-deploy/include/defaults/rest-proxy.sh
To override them for a specific Rest proxy instance, you will need to modify platform-config/tenants/{tenant-name}/instances/{instance-name}/rest-proxy.sh
file.
Configuration | Required / Optional | Description | Default Value | Since |
---|---|---|---|---|
|
Optional |
Rest-Proxy enabled |
|
1.0.0 |
|
Optional |
Determines the docker image version to use for rest-proxy |
|
1.0.0 |
|
Optional |
Root logging level |
|
1.0.0 |
|
Optional |
Kafka logging level |
|
1.0.0 |
|
Optional |
Rest-Proxy logging level |
|
1.0.0 |
|
Optional |
Logging configuration |
|
1.0.0 |
|
Optional |
Interval (in ms) between AdminClient method call retries |
|
1.0.0 |
|
Optional |
Provided to AdminClient on creation as |
|
1.0.0 |
|
Optional |
Serde config: Maximum number of schemas to create or cache locally |
|
1.0.0 |
|
Optional |
Consumer cleanup interval (in ms) |
|
1.0.0 |
|
Optional |
Active Consumers will call poll() every such interval (in ms) so that they are not marked dead |
|
1.0.0 |
|
Optional |
The number of threads that the server spawns to process messages per consume request |
|
1.0.0 |
|
Optional |
Prometheus open endpoints |
|
1.0.0 |
|
Optional |
Management open endpoints |
|
1.0.0 |
|
Optional |
Management server SSL enable |
|
1.0.0 |
|
Optional |
Management security enable |
|
1.0.0 |
|
Optional |
Superusers are always allowed to impersonate |
|
1.0.0 |
|
Optional |
This will be used instead of |
|
1.0.0 |
|
Optional |
Impersonators are allowed to call the Proxy on behalf of another application. The certificate DN or chain of DNs must be provided using the X-SSL-Client-DN header |
|
1.0.0 |
|
Optional |
This will be used instead of |
|
1.0.0 |
|
Required |
The security protocol used by Rest proxy, SSL is advised |
|
1.0.0 |
|
Required |
Rest-Proxy Principal |
|
1.0.0 |
|
Required |
This will be used instead of |
|
1.0.0 |
|
Required |
Server SSL Protocol. TLSv1.2 is suggested |
|
1.0.0 |
|
Required |
Server keystore password |
|
1.0.0 |
|
Required |
Server key password |
|
1.0.0 |
|
Required |
Client authentication |
|
1.0.0 |
|
Required |
Client keystore password |
|
1.0.0 |
|
Required |
Client key password |
|
1.0.0 |
|
Required |
JMX enabled |
|
1.0.0 |
|
Optional |
Prometheus enabled |
|
1.0.0 |
|
Required |
Port to be used to connect to Rest-Proxy |
|
1.0.0 |
|
Required |
Prometheus scrapes the metrics from this port |
|
1.0.0 |
|
Required |
Metrics are exposed on this port |
|
1.0.0 |
Overriding Rest Proxy Producer/Consumer Settings
You can override any Rest proxy producer/consumer configuration that are supported by kafka. It’s fully dynamic and flexible.
Axual CLI
To override configuration in Axual CLI, you have to add producer/consumer prefix following the configuration key and a value.
REST_PROXY_PRODUCER_OVERRIDE_
is a prefix for producer. And REST_PROXY_CONSUMER_OVERRIDE_
is a prefix for consumer config and rest is a configuration key and a value.
{Producer/Consumer prefix}_{kafka configuration} |
Example:
# Rest-Proxy Producer Config
REST_PROXY_PRODUCER_OVERRIDE_METADATA_MAX_AGE_MS=180000
REST_PROXY_PRODUCER_OVERRIDE_CONNECTIONS_MAX_IDLE_MS=180000
REST_PROXY_PRODUCER_OVERRIDE_REQUEST_TIMEOUT_MS=15000
REST_PROXY_PRODUCER_OVERRIDE_RETRIES=1
REST_PROXY_PRODUCER_OVERRIDE_MAX_BLOCK_MS=15000
REST_PROXY_PRODUCER_OVERRIDE_ACKS=all
REST_PROXY_PRODUCER_OVERRIDE_BATCH_SIZE=16384
REST_PROXY_PRODUCER_OVERRIDE_LINGER_MS=50
REST_PROXY_PRODUCER_OVERRIDE_MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION=10
REST_PROXY_PRODUCER_OVERRIDE_SEND_BUFFER_BYTES=131072
REST_PROXY_PRODUCER_OVERRIDE_RECEIVE_BUFFER_BYTES=32768
# Rest-Proxy Consumer Config
REST_PROXY_CONSUMER_OVERRIDE_METADATA_MAX_AGE_MS=180000
REST_PROXY_CONSUMER_OVERRIDE_CONNECTIONS_MAX_IDLE_MS=180000
REST_PROXY_CONSUMER_OVERRIDE_AUTO_OFFSET_RESET=latest
REST_PROXY_CONSUMER_OVERRIDE_MAX_POLL_RECORDS=20
Helm Charts
With k8s deployments are getting easier. To achieve that we have developed our Axual Helm Charts to run the Axual Platform on your local machine. Check Using the HELM charts section.
-
Create a values.yaml file in your working directory.
Replace
kafka configuration
dots.
with dashes-
values.yamlinstance: restproxy: axual: producer: # Rest-Proxy configuration config: # Overrides kafka producer configuration metadata-max-age-ms: 180000 connections-max-idle-ms: 180000 request-timeout-ms: 120000 retries: 3 max-block-ms: 60000 acks: all batch-size: 10 linger-ms: 1 max-in-flight-requests-per-connection: 5 send-buffer-bytes: 10000 receive-buffer-bytes: 10000 consumer: # Rest-Proxy configuration numberOfThreads: 10 config: # Overrides kafka consumer configuration metadata-max-age-ms: 180000 connections-max-idle-ms: 180000
-
Issue a helm upgrade command with the values.yaml as input file to upgrade Axual Platform configuration.
helm upgrade --install platform axual-stable/platform -f ./values.yaml -n kafka
-
Alternatively you can override a specific property with the
--set
optionhelm upgrade --install platform axual-stable/platform --set instance.restproxy.axual.producer.config.metadata-max-age-ms=200000 -n kafka
If you want to override configuration per produce/consume request, then it’s possible but there is limited configuration options. You can add the config in request HTTP Headers. |
Static Kafka and Schema Registry configuration
With Helm deployments, it is possible to configure the Rest Proxy in a way to exclude the dependencies from the Discovery Service.
This can be achieved with proper configuration in the values.yml file.
The relevant configurations are the following:
Configuration | Required / Optional | Description | Default Value |
---|---|---|---|
|
Optional |
Configuration via |
|
|
Required if |
Static configuration for the Rest Proxy |
|
Below an example of a static configuration:
instance:
restproxy:
axual:
config-mode: "static"
staticConfig: # Only used if `config-mode` = `static`
tenant: "axual"
instance: "local"
cluster: "local"
bootstrap.servers: "platform.local:31757"
schema.registry.url: "https://platform.local:25000"
group.id.resolver: "io.axual.common.resolver.GroupPatternResolver"
group.id.pattern: "{tenant}-{instance}-{environment}-{group}"
topic.resolver: "io.axual.common.resolver.TopicPatternResolver"
topic.pattern: "{tenant}-{instance}-{environment}-{topic}"
transactional.id.resolver: "io.axual.common.resolver.TransactionalIdPatternResolver"
transactional.id.pattern: "{tenant}-{instance}-{environment}-{transactional.id}"
acl.principal.builder: io.axual.security.principal.AdvancedAclPrincipalBuilder