|
| 1 | +--- |
| 2 | +#==============================================================# |
| 3 | +# File : kafka.yml |
| 4 | +# Desc : pigsty: 4 node kafka demo (dynamic KRaft) |
| 5 | +# Ctime : 2026-07-17 |
| 6 | +# Mtime : 2026-07-17 |
| 7 | +# Docs : https://pigsty.io/docs/kafka |
| 8 | +# License : Apache-2.0 @ https://pigsty.io/docs/about/license/ |
| 9 | +# Copyright : 2018-2026 Ruohang Feng / Vonng (rh@vonng.com) |
| 10 | +#==============================================================# |
| 11 | + |
| 12 | +# One pass installation with: |
| 13 | +# ./deploy.yml |
| 14 | +# ./kafka.yml -l kf-main |
| 15 | +# ./kafka.yml -l kf-test |
| 16 | +#==============================================================# |
| 17 | +# 1. kf-meta-1 @ 10.10.10.10:9092 single-node dev cluster (plaintext) |
| 18 | +# 2. kf-test-1 @ 10.10.10.11:9092 \ |
| 19 | +# 3. kf-test-2 @ 10.10.10.12:9092 --- 3-node production baseline (scram) |
| 20 | +# 4. kf-test-3 @ 10.10.10.13:9092 / dynamic KRaft, TLS/SCRAM/ACL, RF=3/minISR=2 |
| 21 | +#==============================================================# |
| 22 | +# kafka clients are cluster-aware and connect to every broker directly: |
| 23 | +# bootstrap with e.g. 10.10.10.11:9092,10.10.10.12:9092,10.10.10.13:9092 |
| 24 | + |
| 25 | + |
| 26 | +all: |
| 27 | + children: |
| 28 | + |
| 29 | + # infra cluster for proxy, monitor, alert, etc.. |
| 30 | + infra: { hosts: { 10.10.10.10: { infra_seq: 1 } } } |
| 31 | + |
| 32 | + # single-node kafka dev cluster: combined broker/controller, plaintext |
| 33 | + kf-meta: |
| 34 | + hosts: |
| 35 | + 10.10.10.10: { kafka_seq: 1 } |
| 36 | + vars: |
| 37 | + kafka_cluster: kf-meta |
| 38 | + kafka_topics: |
| 39 | + - { name: quickstart.events ,partitions: 1 ,replication_factor: 1 ,config: { retention.ms: 86400000 } } |
| 40 | + |
| 41 | + # 3-node production baseline: dynamic KRaft, TLS/SCRAM/ACL, RF=3/minISR=2 |
| 42 | + kf-test: |
| 43 | + hosts: |
| 44 | + 10.10.10.11: { kafka_seq: 1 } |
| 45 | + 10.10.10.12: { kafka_seq: 2 } |
| 46 | + 10.10.10.13: { kafka_seq: 3 } |
| 47 | + vars: |
| 48 | + kafka_cluster: kf-test |
| 49 | + kafka_security: scram |
| 50 | + kafka_users: # app principal with prefixed topic/group acls |
| 51 | + - name: test-app |
| 52 | + password: KafkaApp.Test |
| 53 | + acls: |
| 54 | + - { resource: topic ,name: 'test.' ,pattern: prefixed ,operations: [ Read, Write, Describe ] } |
| 55 | + - { resource: group ,name: 'test.' ,pattern: prefixed ,operations: [ Read ] } |
| 56 | + - { resource: cluster ,name: kafka-cluster ,operations: [ Describe, IdempotentWrite ] } |
| 57 | + kafka_topics: |
| 58 | + - name: test.events |
| 59 | + partitions: 3 |
| 60 | + replication_factor: 3 |
| 61 | + config: { min.insync.replicas: 2 ,cleanup.policy: delete ,retention.ms: 604800000 } |
| 62 | + |
| 63 | + vars: |
| 64 | + version: v4.4.0 # pigsty version string |
| 65 | + admin_ip: 10.10.10.10 # admin node ip address |
| 66 | + region: default # upstream mirror region: default|china|europe |
| 67 | + infra_portal: # infra services exposed via portal |
| 68 | + home : { domain: i.pigsty } # default domain name |
| 69 | + |
| 70 | + # kafka & java packages are required in the local repo for the kafka module (if using local repo) |
| 71 | + repo_extra_packages: [ kafka-stack ,java-runtime ] |
| 72 | + |
| 73 | + #----------------------------------------------# |
| 74 | + # PASSWORD : https://pigsty.io/docs/setup/security/ |
| 75 | + #----------------------------------------------# |
| 76 | + grafana_admin_password: pigsty |
| 77 | + grafana_view_password: DBUser.Viewer |
| 78 | +... |
0 commit comments