kafka k8s部署(Strimzi/kafka)
【代码】kafka k8s部署(Strimzi/kafka)
·
- github 地址
- 下载文件方便后续使用
wget https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.33.2/strimzi-0.33.2.tar.gz
tar -xzf strimzi-0.33.2.tar.gz
- 安装 strimzi-cluster-operator
kubectl create ns kafka
kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka
# 等待pod启动完成
kubectl get pods -n kafka
- 部署kafka
cp strimzi-0.33.2/examples/kafka/kafka-persistent.yaml ./
# 根据需求更改 kafka-persistent.yaml 例如修改存储大小和使用nodeport端口
vim kafka-persistent.yaml
-----------------------------------
...
spec:
kafka:
version: 3.4.0
replicas: 3
listeners:
- name: external
port: 9094
type: nodeport
tls: false
configuration:
bootstrap:
nodePort: 30091
brokers:
- broker: 0
nodePort: 30092
- broker: 1
nodePort: 30093
- broker: 2
nodePort: 30094
- name: plain
port: 9092
type: internal
tls: false
- name: tls
port: 9093
type: internal
tls: true
...
storage:
type: jbod
volumes:
- id: 0
type: persistent-claim
size: 10Gi
deleteClaim: false
...
...
-----------------------------------
kubectl apply -f kafka-persistent.yaml -n kafka
更多推荐
已为社区贡献6条内容
所有评论(0)