Configuration
Configuration
To set up the configuration settings used by Jikkou CLI, you will need create a jikkou config file, which is created automatically when you create a configuration context using:
jikkou config set-context <context-name> [--config-file=<config-file>] [--config-props=<config-value>]
By default, the configuration of jikkou is located under the path $HOME/.jikkou/config.
This jikkou config file defines all the contexts that can be used by jikkou CLI.
For example, below is the config file created during the Getting Started.
{
"currentContext": "localhost",
"localhost": {
"configFile": null,
"configProps": {
"provider.kafka.client.bootstrap.servers": "localhost:9092"
}
}
}
Most of the time, a context does not directly contain the configuration properties to be used, but rather points to a
specific HOCON (Human-Optimized Config Object Notation) through the configFile property.
Then, the configProps allows you to override some of the property define by this file.
In addition, if no configuration file path is specified, Jikkou will lookup for an application.conf to
those following locations:
./application.conf$HOME/.jikkou/application.conf
Finally, Jikkou always fallback to a reference.conf file that you can use as a template to define your own configuration.
reference.conf:
jikkou {
# Configure Jikkou Proxy Mode
# proxy {
# url = "http://localhost:8080"
# }
# Configure Extension Providers
extension {
}
# Core
provider.core {
enabled = true
}
# Apache Kafka Provider
provider.kafka {
enabled = true
type = io.streamthoughts.jikkou.kafka.KafkaExtensionProvider
config = {
# The default Kafka Client configuration
client {
bootstrap.servers = "localhost:9092"
bootstrap.servers = ${?JIKKOU_DEFAULT_KAFKA_BOOTSTRAP_SERVERS}
}
brokers {
# If 'True'
waitForEnabled = true
waitForEnabled = ${?JIKKOU_KAFKA_BROKERS_WAIT_FOR_ENABLED}
# The minimal number of brokers that should be alive for the CLI stops waiting.
waitForMinAvailable = 1
waitForMinAvailable = ${?JIKKOU_KAFKA_BROKERS_WAIT_FOR_MIN_AVAILABLE}
# The amount of time to wait before verifying that brokers are available.
waitForRetryBackoffMs = 1000
waitForRetryBackoffMs = ${?JIKKOU_KAFKA_BROKERS_WAIT_FOR_RETRY_BACKOFF_MS}
# Wait until brokers are available or this timeout is reached.
waitForTimeoutMs = 60000
waitForTimeoutMs = ${?JIKKOU_KAFKA_BROKERS_WAIT_FOR_TIMEOUT_MS}
}
}
}
# Schema Registry Provider
provider.schemaregistry {
enabled = true
type = io.streamthoughts.jikkou.schema.registry.SchemaRegistryExtensionProvider
config = {
url = "http://localhost:8081"
url = ${?JIKKOU_DEFAULT_SCHEMA_REGISTRY_URL}
}
}
# The default custom transformations to apply on any resources.
transformations = []
# The default custom validations to apply on any resources.
validations = [
{
name = "topicMustHaveValidName"
type = io.streamthoughts.jikkou.kafka.validation.TopicNameRegexValidation
priority = 100
config = {
topicNameRegex = "[a-zA-Z0-9\\._\\-]+"
topicNameRegex = ${?VALIDATION_DEFAULT_TOPIC_NAME_REGEX}
}
},
{
name = "topicMustHavePartitionsEqualsOrGreaterThanOne"
type = io.streamthoughts.jikkou.kafka.validation.TopicMinNumPartitionsValidation
priority = 100
config = {
topicMinNumPartitions = 1
topicMinNumPartitions = ${?VALIDATION_DEFAULT_TOPIC_MIN_NUM_PARTITIONS}
}
},
{
name = "topicMustHaveReplicasEqualsOrGreaterThanOne"
type = io.streamthoughts.jikkou.kafka.validation.TopicMinReplicationFactorValidation
priority = 100
config = {
topicMinReplicationFactor = 1
topicMinReplicationFactor = ${?VALIDATION_DEFAULT_TOPIC_MIN_REPLICATION_FACTOR}
}
}
]
# The default custom reporters to report applied changes.
reporters = [
# Uncomment following lines to enable default kafka reporter
# {
# name = "default"
# type = io.streamthoughts.jikkou.kafka.reporter.KafkaChangeReporter
# config = {
# event.source = "jikkou/cli"
# kafka = {
# topic.creation.enabled = true
# topic.creation.defaultReplicationFactor = 1
# topic.name = "jikkou-resource-change-event"
# client = ${jikkou.kafka.client} {
# client.id = "jikkou-reporter-producer"
# }
# }
# }
# }
]
jinja {
enableRecursiveMacroCalls = false
}
}
Managing Contexts
For detailed usage of all configuration commands, see the Commands Reference:
- jikkou config set-context - Create or update a configuration context
- jikkou config get-contexts - List all configured contexts
- jikkou config current-context - Show the current context
- jikkou config use-context - Switch to a different context
- jikkou config view - Show the merged configuration
Tips
To debug the configuration used by Jikkou, you can run the following command:jikkou config view --comments
or jikkou config view --debug