kafka/variables.yml

200 lines
5.3 KiB
YAML
Raw Normal View History

2024-04-03 12:16:16 +02:00
---
2024-04-08 12:01:53 +02:00
# Name of this instance
# Only usefull if you intent to run several instances on your cluster (in the same namespace)
2024-04-03 12:16:16 +02:00
instance: kafka
vault:
2024-04-08 12:01:53 +02:00
# PKI settings
2024-04-03 12:16:16 +02:00
pki:
path: "[[ .vault.root ]]pki/kafka"
ou: Kafka Cluster ([[ .instance ]])
kafka:
broker:
2024-04-08 12:01:53 +02:00
# Number of brokers to run
2024-04-03 12:16:16 +02:00
count: 3
2024-04-08 12:01:53 +02:00
# Version of Kafka to use to build the image
2024-04-03 12:16:16 +02:00
version: 3.7.0
2024-04-08 12:01:53 +02:00
# Docker image to use
2024-04-08 10:47:58 +02:00
image: '[[ .docker.repo ]]kafka-broker:[[ .kafka.broker.version ]]-4'
2024-04-08 12:01:53 +02:00
# Custom env var to set in the container
2024-04-03 12:16:16 +02:00
env: {}
2024-04-08 12:01:53 +02:00
# Resource allocation for each broker
2024-04-03 12:16:16 +02:00
resources:
cpu: 100
memory: 1024
2024-04-08 12:01:53 +02:00
# Prometheus settings
2024-04-03 12:16:16 +02:00
prometheus:
enabled: '[[ .prometheus.available ]]'
2024-04-08 10:47:58 +02:00
metrics_url: http://127.0.0.1:9404/metrics
2024-04-08 12:01:53 +02:00
# You can set static ports for both client and broker port. If not set, ports will be allocated dynamicaly by Nomad
2024-04-03 12:16:16 +02:00
# static_client_port: 9092
# static_broker_port: 9095
2024-04-08 12:01:53 +02:00
# Ensure all broker runs on distinct hosts
2024-04-04 11:53:44 +02:00
nomad:
constraints:
- operator: distinct_hosts
value: true
2024-04-08 12:01:53 +02:00
# Consul settings
2024-04-03 12:16:16 +02:00
consul:
meta:
2024-04-08 12:01:53 +02:00
# Push the name of the broker as a meta of the service
2024-04-04 11:53:44 +02:00
broker: 'broker-${NOMAD_ALLOC_INDEX}.[[ .instance ]]-broker[[ .consul.suffix ]].service.[[ .consul.domain ]]'
2024-04-08 12:01:53 +02:00
# Service mesh
2024-04-03 12:16:16 +02:00
connect:
upstreams:
2024-04-08 12:01:53 +02:00
# Default is to contact a zookeeper cluster through the mesh
2024-04-03 12:16:16 +02:00
- destination_name: zookeeper[[ .consul.suffix ]]
local_bind_port: 2181
2024-04-08 12:01:53 +02:00
# Vault settings
2024-04-03 12:16:16 +02:00
vault:
2024-04-08 12:01:53 +02:00
# Policies to attach to the task
2024-04-03 12:16:16 +02:00
policies:
- '[[ .instance ]]-broker[[ .consul.suffix ]]'
2024-04-08 12:01:53 +02:00
# Wait for ZooKeeper to be available before starting brokers
2024-04-03 12:16:16 +02:00
wait_for:
- service: zookeeper[[ .consul.suffix ]]
count: 2
2024-04-08 12:01:53 +02:00
# ZpooKeeper settings
2024-04-03 12:16:16 +02:00
zookeeper:
servers:
- 127.0.0.1:2181
# path: /kafka
user: ""
password: ""
2024-04-08 12:01:53 +02:00
# If set to false, ACL will be disabled
2024-04-03 12:16:16 +02:00
use_acl: true
2024-04-08 12:01:53 +02:00
# List of super user on this kafka cluster
2024-04-03 12:16:16 +02:00
super_users:
- '[[ .instance ]]-jikkou'
2024-04-08 12:01:53 +02:00
# Kafka brokers settings
2024-04-03 12:16:16 +02:00
settings:
log.retention.hours: 168
compression.type: zstd
zookeeper.connection.timeout.ms: 600
zookeeper.set.acl: true
message.max.bytes: 1073741824
auto.create.topics.enable: false
transactional.id.expiration.ms: 2147483647
offsets.retention.minutes: 13140
2024-04-08 12:01:53 +02:00
# Volumes for data persistence
2024-04-03 12:16:16 +02:00
volumes:
data:
type: csi
source: '[[ .instance ]]-broker-data'
per_alloc: true
2024-04-08 12:01:53 +02:00
# Jikkou can manage topics and ACL on your cluster
2024-04-03 12:16:16 +02:00
jikkou:
2024-04-08 12:01:53 +02:00
# Version of Jikkou to use when building the image
2024-05-01 23:49:42 +02:00
version: 0.34.0
2024-04-08 12:01:53 +02:00
# Docker image to use
2024-04-03 12:16:16 +02:00
image: '[[ .docker.repo ]]jikkou:[[ .kafka.jikkou.version ]]-1'
2024-04-08 12:01:53 +02:00
# Custom env var to set in the container
2024-04-03 12:16:16 +02:00
env: {}
2024-04-08 12:01:53 +02:00
# Resource allocation
2024-04-03 12:16:16 +02:00
resources:
cpu: 10
memory: 256
2024-04-08 12:01:53 +02:00
2024-04-03 12:16:16 +02:00
vault:
2024-04-08 12:01:53 +02:00
# Vault policies to attach to the task
2024-04-03 12:16:16 +02:00
policies:
- '[[ .instance ]]-jikkou[[ .consul.suffix ]]'
2024-04-08 12:01:53 +02:00
# 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 ]]'
# 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 ]
2024-04-03 12:16:16 +02:00
topics: ""
2024-04-08 12:01:53 +02:00
# 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: '*'
2024-04-03 12:16:16 +02:00
acls: ""
2024-04-08 12:01:53 +02:00
# Prometheus exporter
2024-04-03 12:16:16 +02:00
exporter:
2024-04-08 12:01:53 +02:00
# Version of the exporter to use when building the image
2024-04-03 12:16:16 +02:00
version: 1.7.0
2024-04-08 12:01:53 +02:00
# Docker image to use
2024-04-03 12:16:16 +02:00
image: '[[ .docker.repo ]]kafka-exporter:[[ .kafka.exporter.version ]]-1'
2024-04-08 12:01:53 +02:00
# Custom env var to set in the container
2024-04-03 12:16:16 +02:00
env: {}
2024-04-08 12:01:53 +02:00
# Wait for a quorum of brokers to be ready before starting the exporter
2024-04-03 12:16:16 +02:00
wait_for:
- service: '[[ .instance ]]-broker[[ .consul.suffix ]]'
count: '[[ .kafka.broker.count | mul 0.5 | add 1 | math.Floor ]]'
2024-04-08 12:01:53 +02:00
2024-04-03 12:16:16 +02:00
vault:
2024-04-08 12:01:53 +02:00
# Vault policies to attach to the task
2024-04-03 12:16:16 +02:00
policies:
- '[[ .instance ]]-exporter[[ .consul.suffix ]]'
- metrics[[ .consul.suffix ]]
2024-04-08 12:01:53 +02:00
# Resource allocation
2024-04-03 12:16:16 +02:00
resources:
cpu: 10
memory: 50