Comment variables.yml

This commit is contained in:
Daniel Berteaud 2024-04-08 12:01:53 +02:00
parent 279996ad25
commit d328ad3491
1 changed files with 114 additions and 6 deletions

View File

@ -1,52 +1,87 @@
--- ---
# Name of this instance
# Only usefull if you intent to run several instances on your cluster (in the same namespace)
instance: kafka instance: kafka
vault: vault:
# PKI settings
pki: pki:
path: "[[ .vault.root ]]pki/kafka" path: "[[ .vault.root ]]pki/kafka"
ou: Kafka Cluster ([[ .instance ]]) ou: Kafka Cluster ([[ .instance ]])
kafka: kafka:
broker: broker:
# Number of brokers to run
count: 3 count: 3
# Version of Kafka to use to build the image
version: 3.7.0 version: 3.7.0
# Docker image to use
image: '[[ .docker.repo ]]kafka-broker:[[ .kafka.broker.version ]]-4' image: '[[ .docker.repo ]]kafka-broker:[[ .kafka.broker.version ]]-4'
# Custom env var to set in the container
env: {} env: {}
# Resource allocation for each broker
resources: resources:
cpu: 100 cpu: 100
memory: 1024 memory: 1024
# Prometheus settings
prometheus: prometheus:
enabled: '[[ .prometheus.available ]]' enabled: '[[ .prometheus.available ]]'
metrics_url: http://127.0.0.1:9404/metrics metrics_url: http://127.0.0.1:9404/metrics
# You can set static ports for both client and broker port. If not set, ports will be allocated dynamicaly by Nomad
# static_client_port: 9092 # static_client_port: 9092
# static_broker_port: 9095 # static_broker_port: 9095
# Ensure all broker runs on distinct hosts
nomad: nomad:
constraints: constraints:
- operator: distinct_hosts - operator: distinct_hosts
value: true value: true
# Consul settings
consul: consul:
meta: meta:
# Push the name of the broker as a meta of the service
broker: 'broker-${NOMAD_ALLOC_INDEX}.[[ .instance ]]-broker[[ .consul.suffix ]].service.[[ .consul.domain ]]' broker: 'broker-${NOMAD_ALLOC_INDEX}.[[ .instance ]]-broker[[ .consul.suffix ]].service.[[ .consul.domain ]]'
# Service mesh
connect: connect:
upstreams: upstreams:
# Default is to contact a zookeeper cluster through the mesh
- destination_name: zookeeper[[ .consul.suffix ]] - destination_name: zookeeper[[ .consul.suffix ]]
local_bind_port: 2181 local_bind_port: 2181
# Vault settings
vault: vault:
# Policies to attach to the task
policies: policies:
- '[[ .instance ]]-broker[[ .consul.suffix ]]' - '[[ .instance ]]-broker[[ .consul.suffix ]]'
# Wait for ZooKeeper to be available before starting brokers
wait_for: wait_for:
- service: zookeeper[[ .consul.suffix ]] - service: zookeeper[[ .consul.suffix ]]
count: 2 count: 2
# ZpooKeeper settings
zookeeper: zookeeper:
servers: servers:
- 127.0.0.1:2181 - 127.0.0.1:2181
# path: /kafka # path: /kafka
user: "" user: ""
password: "" password: ""
# If set to false, ACL will be disabled
use_acl: true use_acl: true
# List of super user on this kafka cluster
super_users: super_users:
- '[[ .instance ]]-jikkou' - '[[ .instance ]]-jikkou'
# Kafka brokers settings
settings: settings:
log.retention.hours: 168 log.retention.hours: 168
compression.type: zstd compression.type: zstd
@ -56,36 +91,109 @@ kafka:
auto.create.topics.enable: false auto.create.topics.enable: false
transactional.id.expiration.ms: 2147483647 transactional.id.expiration.ms: 2147483647
offsets.retention.minutes: 13140 offsets.retention.minutes: 13140
# Volumes for data persistence
volumes: volumes:
data: data:
type: csi type: csi
source: '[[ .instance ]]-broker-data' source: '[[ .instance ]]-broker-data'
per_alloc: true per_alloc: true
# Jikkou can manage topics and ACL on your cluster
jikkou: jikkou:
# Version of Jikkou to use when building the image
version: 0.33.3 version: 0.33.3
# Docker image to use
image: '[[ .docker.repo ]]jikkou:[[ .kafka.jikkou.version ]]-1' image: '[[ .docker.repo ]]jikkou:[[ .kafka.jikkou.version ]]-1'
# Custom env var to set in the container
env: {} env: {}
# Resource allocation
resources: resources:
cpu: 10 cpu: 10
memory: 256 memory: 256
vault: vault:
# Vault policies to attach to the task
policies: policies:
- '[[ .instance ]]-jikkou[[ .consul.suffix ]]' - '[[ .instance ]]-jikkou[[ .consul.suffix ]]'
topics: ""
acls: ""
exporter: # Wait for a quorum of brokers to be ready before starting the exporter
version: 1.7.0
image: '[[ .docker.repo ]]kafka-exporter:[[ .kafka.exporter.version ]]-1'
env: {}
wait_for: wait_for:
- service: '[[ .instance ]]-broker[[ .consul.suffix ]]' - service: '[[ .instance ]]-broker[[ .consul.suffix ]]'
count: '[[ .kafka.broker.count | mul 0.5 | add 1 | math.Floor ]]' count: '[[ .kafka.broker.count | mul 0.5 | add 1 | math.Floor ]]'
# List of topics to create, as a YAML string. Eg
# topics: |
# ---
# apiVersion: "core.jikkou.io/v1beta2"
# kind: ConfigMap
# metadata:
# name: 'TopicDefaultConfig'
# data:
# min.insync.replicas: 2
# cleanup.policy: delete
# compression.type: zstd
# retention.ms: 604800000
# ---
# apiVersion: kafka.jikkou.io/v1beta2
# kind: KafkaTopicList
# items:
# - metadata:
# name: my_topic
# spec:
# partitions: 12
# replicas: 3
# configMapRefs: [ TopicDefaultConfig ]
topics: ""
# List of ACL, as a YAML string. Eg
# acls: |
# ---
# apiVersion: kafka.jikkou.io/v1beta2
# kind: KafkaPrincipalRole
# metadata:
# name: foobar-consumer
# spec:
# acls:
# - type: ALLOW
# operations: [READ, DESCRIBE]
# resource:
# type: TOPIC
# pattern: {{ $topic }}
# patternType: LITERAL
# host: '*'
# - type: ALLOW
# operations: [READ]
# resource:
# type: GROUP
# pattern: {{ $topic }}
# patternType: LITERAL
# host: '*'
acls: ""
# Prometheus exporter
exporter:
# Version of the exporter to use when building the image
version: 1.7.0
# Docker image to use
image: '[[ .docker.repo ]]kafka-exporter:[[ .kafka.exporter.version ]]-1'
# Custom env var to set in the container
env: {}
# Wait for a quorum of brokers to be ready before starting the exporter
wait_for:
- service: '[[ .instance ]]-broker[[ .consul.suffix ]]'
count: '[[ .kafka.broker.count | mul 0.5 | add 1 | math.Floor ]]'
vault: vault:
# Vault policies to attach to the task
policies: policies:
- '[[ .instance ]]-exporter[[ .consul.suffix ]]' - '[[ .instance ]]-exporter[[ .consul.suffix ]]'
- metrics[[ .consul.suffix ]] - metrics[[ .consul.suffix ]]
# Resource allocation
resources: resources:
cpu: 10 cpu: 10
memory: 50 memory: 50