Skip to content

Commit 278e925

Browse files
authored
Added full config file description (#54)
1 parent a2f53be commit 278e925

File tree

1 file changed

+232
-30
lines changed

1 file changed

+232
-30
lines changed

configuration/configuration-file.md

Lines changed: 232 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,238 @@ We will mostly provide examples of configs in YAML format, but sometimes single
1414

1515
Rather than writing your config from a scratch, it would be more convenient to use one of the ready-to-go [compose examples](compose-examples.md) and adjust it to your needs.
1616

17+
#### Config file description ####
18+
19+
```yaml
20+
# ======================================================
21+
# Kafka Clusters Configuration
22+
# Define all Kafka cluster-specific settings and related integrations.
23+
# ======================================================
24+
kafka:
25+
clusters:
26+
- name: local # Unique name identifier for the Kafka cluster
27+
bootstrap-servers: kafka1:9092,kafka2:9092 # List of Kafka broker addresses
28+
29+
# SSL configuration for secure connection to Kafka brokers
30+
ssl:
31+
truststore-location: path/to/truststore/file.jks # Path to truststore JKS file
32+
truststore-password: password # Password to access the truststore
33+
verify-ssl: true # Enable SSL certificate verification
34+
35+
# Schema Registry connection and authentication details
36+
schemaRegistry: http://schema-registry:8085
37+
schema-registry-auth:
38+
username: schema registry username
39+
password: schema registry password
40+
schema-registry-ssl:
41+
keystore-location: path/to/keystore/file.jks
42+
keystore-password: password
43+
44+
# ksqlDB connection and security settings
45+
ksqldb-server: http://ksqldb-host:8088
46+
ksqldb-server-auth:
47+
username: ksqldb-username
48+
password: ksqdb-passsword
49+
ksqldb-server-ssl:
50+
keystore-location: path/to/keystore/file.jks
51+
keystore-password: password
52+
53+
# Kafka Connect REST endpoint and optional authentication
54+
kafka-connect:
55+
- name: first # Identifier for the Connect cluster
56+
address: http://kafka-connect-host:8083
57+
username: Auth username
58+
password: Auth password
59+
keystore-location: path/to/keystore/file.jks
60+
keystore-password: keystore password
61+
62+
# Custom SerDe (Serializer/Deserializer) for interpreting topic data
63+
serde:
64+
- name: CustomeHexWithEditedDelimiter
65+
class-name: io.kafbat.ui.serdes.builtin.HexSerde
66+
file-path: /var/lib/kui-serde/my-kui-serde.jar
67+
topic-keys-pattern: ".*-events" # Regex to match applicable topic keys
68+
topic-values-pattern: ".*-events" # Regex to match applicable topic values
69+
properties:
70+
uppercase: "false" # Output lowercase hex
71+
delimiter: ":" # Byte delimiter
72+
73+
default-key-serde: String # Default SerDe for message keys
74+
default-value-serde: SchemaRegistry # Default SerDe for message values
75+
76+
# Monitoring and metrics collection from the cluster
77+
metrics:
78+
type: JMX # Available options: JMX or PROMETHEUS
79+
port: 9997 # Port to collect JMX metrics
80+
username: Auth username
81+
password: Auth password
82+
ssl: false # Whether to use SSL for metrics endpoint
83+
keystore-location: path/to/keystore/file.jks
84+
keystore-password: password
85+
86+
# Global Kafka client properties
87+
properties:
88+
"security.protocol": SASL_SSL
89+
"sasl.mechanism": SCRAM-SHA-512
90+
"sasl.jaas.config": org.apache.kafka.common.security.scram.ScramLoginModule required username="your-username" password="your-password";
91+
92+
# Kafka Consumer configuration overrides
93+
consumer-properties:
94+
"max.partition.fetch.bytes": 1048576
95+
96+
# Kafka Producer configuration overrides
97+
producer-properties:
98+
"enable.idempotence": false
99+
100+
read-only: true # Prevent write operations from the UI
101+
102+
polling-throttle-rate: 0 # Delay (seconds) between polling intervals in UI; 0 = no throttling
103+
104+
# Data masking rules for messages shown in the UI
105+
masking:
106+
- type: MASK # Action: MASK, REMOVE, or REPLACE
107+
fields: [ "id", "name" ] # Specific fields to apply masking to
108+
fields-name-pattern: "id.*" # Regex pattern to match field names
109+
masking-chars-replacement: ["A", "a", "N", "_"] # Optional: override default mask characters
110+
replacement: "***MASKED_FIELD_NAME***" # Replacement string for masked field names
111+
topic-values-pattern: events-with-ids-.* # Apply on topic values matching this pattern
112+
topic-keys-pattern: events-with-ids-.* # Apply on topic keys matching this pattern
113+
114+
# Audit logging configuration
115+
audit:
116+
topic-audit-enabled: false # Enable/disable Kafka topic audit logs
117+
console-audit-enabled: false # Enable/disable console audit output
118+
topic: audit-topic-name # Kafka topic for audit entries
119+
audit-topics-partitions: 3 # Number of partitions for the audit topic
120+
level: ALL # ALL = log all actions, ALTER_ONLY = only mutating actions
121+
audit-topic-properties:
122+
"retention.ms": 43200000 # Audit log retention in ms (12 hours)
123+
124+
# Prefix to identify internal Kafka topics used by system tools
125+
internalTopicPrefix: "__"
126+
127+
# Timeout for admin Kafka operations (in milliseconds)
128+
admin-client-timeout: 30000
129+
130+
# Polling behavior for consumer previews in the UI
131+
polling:
132+
poll-timeout-ms: 1000 # How long to wait for new records (ms)
133+
max-page-size: 500 # Maximum number of records per poll
134+
default-page-size: 100 # Default number of records per poll
135+
136+
# ======================================================
137+
# Model Context Protocol config
138+
# ======================================================
139+
mcp:
140+
enabled: true # Enable MCP (ModelContextProtocol) endpoint
141+
142+
# ======================================================
143+
# OAuth2 Authentication Configuration
144+
# Used for authenticating users via external identity providers.
145+
# ======================================================
146+
auth:
147+
oauth2:
148+
client:
149+
client_name:
150+
client-id: xxx
151+
client-secret: yyy
152+
scope: openid
153+
client-name: cognito # Display name on the login screen
154+
provider: <provider> # Path alias used in redirect URI
155+
redirect-uri: http://localhost:8080/login/oauth2/code/<provider>
156+
authorization-grant-type: authorization_code
157+
issuer-uri: https://xxx # Identity provider URL
158+
jwk-set-uri: https://yyy/.well-known/jwks.json # Public key set URL
159+
user-name-attribute: <zzz> # JWT field used as the user's name
160+
custom-params:
161+
type: <provider_type> # Optional RBAC integration type (e.g. cognito, google, github, oauth)
162+
roles-field: groups # Field containing user roles/groups
163+
164+
resource-server:
165+
jwt:
166+
jwk-set-uri: http://jwk/uri
167+
jws-algorithms: ["RS256"]
168+
issuer-uri: http://issuer/uri
169+
public-key-location: # Optional path to JWT public key
170+
audiences: [] # List of accepted audience values in JWT
171+
authority_prefix: # Optional prefix added to authorities
172+
authorities-claim-delimiter: # Regex delimiter for splitting roles
173+
authorities-claim-name: # Claim name holding roles/permissions
174+
principal-claim-name: # Claim used for determining the username
175+
176+
opaque-token:
177+
client-id: # Client ID used for introspection
178+
client-secret: # Secret used for introspection
179+
introspection-uri: # URL to the introspection endpoint
180+
181+
# ======================================================
182+
# LDAP Configuration
183+
# Used for user and group resolution in RBAC when using LDAP.
184+
# ======================================================
185+
spring:
186+
ldap:
187+
urls: ldap://localhost:10389
188+
base: "cn={0},ou=people,dc=planetexpress,dc=com"
189+
admin-user: "cn=admin,dc=planetexpress,dc=com"
190+
admin-password: "GoodNewsEveryone"
191+
user-filter-search-base: "dc=planetexpress,dc=com"
192+
user-filter-search-filter: "(&(uid={0})(objectClass=inetOrgPerson))"
193+
group-filter-search-base: "ou=people,dc=planetexpress,dc=com"
194+
195+
# ======================================================
196+
# Role-Based Access Control (RBAC)
197+
# Configure roles, user/group bindings, and permissions.
198+
# ======================================================
199+
rbac:
200+
roles:
201+
- name: "memelords" # Role name
202+
clusters:
203+
- local # Clusters this role applies to
204+
subjects:
205+
- provider: oauth_google # e.g. oauth_{client_name}, ldap
206+
type: domain # domain, organization, user, group
207+
value: "kafbat.dev"
208+
permissions:
209+
- resource: applicationconfig # Resource types: applicationconfig, clusterconfig, topic, consumer, schema, connect, ksql, acl, audit
210+
value: ".*"
211+
actions: all # Allowed actions: read, write, all
212+
213+
# ======================================================
214+
# WebClient Settings
215+
# Configuration for HTTP clients used by the app.
216+
# ======================================================
217+
webclient:
218+
response-timeout-ms: 20000 # Timeout for all outgoing HTTP requests
219+
max-in-memory-buffer-size: 20MB # Maximum buffer size for handling responses
220+
221+
# ======================================================
222+
# Spring Boot Actuator
223+
# Enables health, info, and Prometheus endpoints for monitoring.
224+
# ======================================================
225+
management:
226+
endpoint:
227+
info:
228+
enabled: true
229+
health:
230+
enabled: true
231+
endpoints:
232+
web:
233+
exposure:
234+
include: "info,health,prometheus"
235+
236+
# ======================================================
237+
# Application Logging Configuration
238+
# Configure logging levels for specific packages.
239+
# ======================================================
240+
logging:
241+
level:
242+
root: INFO
243+
io.kafbat.ui: DEBUG
244+
reactor.netty.http.server.AccessLog: INFO
245+
org.hibernate.validator: WARN
246+
247+
```
248+
17249
#### Providing a config path for the app instance:
18250

19251
**Docker**:
@@ -42,33 +274,3 @@ services:
42274
```
43275
44276
**Jar**: `java -Dspring.config.additional-location=<path-to-application-local.yml> -jar <path-to-jar>.jar`
45-
46-
#### Basic config structure
47-
48-
```yaml
49-
kafka:
50-
clusters:
51-
-
52-
name: local
53-
bootstrapServers: localhost:29091
54-
schemaRegistry: http://localhost:8085
55-
schemaRegistryAuth:
56-
username: username
57-
password: password
58-
# schemaNameTemplate: "%s-value"
59-
metrics:
60-
port: 9997
61-
type: JMX
62-
```
63-
64-
* `name`: cluster name
65-
* `bootstrapServers`: where to connect
66-
* `schemaRegistry`: schemaRegistry's address
67-
* `schemaRegistryAuth.username`: schemaRegistry's basic authentication username
68-
* `schemaRegistryAuth.password`: schemaRegistry's basic authentication password
69-
* `schemaNameTemplate`: how keys are saved to Schema Registry
70-
* `metrics.port`: open the JMX port of a broker
71-
* `metrics.type`: Type of metrics, either JMX or PROMETHEUS. Defaulted to JMX.
72-
* `readOnly`: enable read-only mode
73-
74-
Configure as many clusters as you need by adding their configs below separated with `-`.

0 commit comments

Comments
 (0)