helm repo add bitnami https://charts.bitnami.com/bitnami
helm pull bitnami/kafka --untar
- 2 添加全局存储 编辑 vim kafka/values.yaml
global:
imageRegistry: ""
imagePullSecrets: []
storageClass: "nfs-ok" <<<StorageClass
helm install kafka bitnami/kafka \
--set statefulset.replicaCount=3 \
--set persistence.enabled=true \
--set persistence.size=8Gi \
--set service.type=NodePort
测试发送
kubectl exec -it kafka-0 -- kafka-console-producer.sh --broker-list kafka-0.kafka-headless.default.svc.cluster.local:9092 --topic test
另外启动终端测试
kubectl exec -it kafka-0 -- kafka-console-consumer.sh --bootstrap-server kafka.default.svc.cluster.local:9092 --topic test --from-beginning