yawyd313 0c28696fdf save 1 month ago
..
templates 0c28696fdf save 1 month ago
Chart.yaml 0c28696fdf save 1 month ago
README.md 0c28696fdf save 1 month ago
kafka-broker_log.log 0c28696fdf save 1 month ago
startkafka.sh 0c28696fdf save 1 month ago
stopkafka.sh 0c28696fdf save 1 month ago
values.yaml 0c28696fdf save 1 month ago

README.md

Kafka helm chart

https://github.com/itboon/kafka-docker

Prerequisites

  • Kubernetes 1.22+
  • Helm 3.3+

获取 helm 仓库

helm repo add kafka-repo https://helm-charts.itboon.top/kafka
helm repo update kafka-repo

部署 Kafka

部署单节点 Kafka 集群

## 下面的部署案例关闭了持久化存储,仅作为演示
helm upgrade --install kafka \
  --namespace kafka-demo \
  --create-namespace \
  --set broker.persistence.enabled="false" \
  kafka-repo/kafka
## 默认已开启持久化存储
helm upgrade --install kafka \
  --namespace kafka-demo \
  --create-namespace \
  kafka-repo/kafka

将 broker 和 controller 分开部署

helm upgrade --install kafka \
  --namespace kafka-demo \
  --create-namespace \
  --set broker.combinedMode.enabled="false" \
  --set controller.replicaCount="1" \
  --set broker.replicaCount="1" \
  kafka-repo/kafka

broker.combinedMode.enabled 混部模式,即进程同时具有 broker + controller 角色,单节点服务器启动一个 Pod 即可。kafka-repo/kafka 默认开启混部,kafka-repo/kafka-ha 默认关闭混部。

部署高可用集群

## kafka-repo/kafka-ha 默认部署 3 controller + 3 broker
helm upgrade --install kafka \
  --namespace kafka-demo \
  --create-namespace \
  kafka-repo/kafka-ha
## 调整集群资源配额
helm upgrade --install kafka \
  --namespace kafka-demo \
  --create-namespace \
  --set controller.replicaCount="3" \
  --set broker.replicaCount="3" \
  --set broker.heapOpts="-Xms4096m -Xmx4096m" \
  --set broker.resources.requests.memory="8Gi" \
  --set broker.resources.limits.memory="16Gi" \
  kafka-repo/kafka-ha

More values please refer to examples/values-production.yml

集群外访问

请参考 https://github.com/itboon/kafka-docker/blob/main/docs/external.md