当前位置: 首页 > article >正文

helm手动部署Kafka集群

1、到指定node节点创建pv需挂载的目录,若有分布式存储可忽略

mkdir -p /data/kafka-data-0 
mkdir -p /data/kafka-data-1 
mkdir -p /data/kafka-data-2 
mkdir -p /data/kafka-zookeeper-data-0

2、创建pvc

---

apiVersion: v1

kind: PersistentVolume

metadata:

name: kafka-pv-0

spec:

capacity:

storage: 50Gi

volumeMode: Filesystem

accessModes:

- ReadWriteOnce

persistentVolumeReclaimPolicy: Retain

storageClassName: local-storage

local:

path: /data/kafka-data-0

nodeAffinity:

required:

nodeSelectorTerms:

- matchExpressions:

- key: kubernetes.io/hostname

operator: In

values:

- node-205

---

kind: PersistentVolumeClaim

apiVersion: v1

metadata:

name: data-kafka-22716-0

spec:

accessModes:

- ReadWriteOnce

storageClassName: local-storage

volumeMode: Filesystem

volumeName: kafka-pv-0

resources:

requests:

storage: 50Gi

---

apiVersion: v1

kind: PersistentVolume

metadata:

name: kafka-pv-1

spec:

capacity:

storage: 50Gi

volumeMode: Filesystem

accessModes:

- ReadWriteOnce

persistentVolumeReclaimPolicy: Retain

storageClassName: local-storage

local:

path: /data/kafka-data-1

nodeAffinity:

required:

nodeSelectorTerms:

- matchExpressions:

- key: kubernetes.io/hostname

operator: In

values:

- node-205

---

kind: PersistentVolumeClaim

apiVersion: v1

metadata:

name: data-kafka-22716-1

spec:

accessModes:

- ReadWriteOnce

storageClassName: local-storage

volumeMode: Filesystem

volumeName: kafka-pv-1

resources:

requests:

storage: 50Gi

---

apiVersion: v1

kind: PersistentVolume

metadata:

name: kafka-pv-2

spec:

capacity:

storage: 50Gi

volumeMode: Filesystem

accessModes:

- ReadWriteOnce

persistentVolumeReclaimPolicy: Retain

storageClassName: local-storage

local:

path: /data/kafka-data-2

nodeAffinity:

required:

nodeSelectorTerms:

- matchExpressions:

- key: kubernetes.io/hostname

operator: In

values:

- node-205

---

kind: PersistentVolumeClaim

apiVersion: v1

metadata:

name: data-kafka-22716-2

spec:

accessModes:

- ReadWriteOnce

storageClassName: local-storage

volumeMode: Filesystem

volumeName: kafka-pv-2

resources:

requests:

storage: 50Gi

---

apiVersion: v1

kind: PersistentVolume

metadata:

name: kafka-zookeeper-pv-0

spec:

capacity:

storage: 50Gi

volumeMode: Filesystem

accessModes:

- ReadWriteOnce

persistentVolumeReclaimPolicy: Retain

storageClassName: local-storage

local:

path: /data/kafka-zookeeper-data-0

nodeAffinity:

required:

nodeSelectorTerms:

- matchExpressions:

- key: kubernetes.io/hostname

operator: In

values:

- node-205

---

kind: PersistentVolumeClaim

apiVersion: v1

metadata:

name: data-kafka-22716-zookeeper-0

spec:

accessModes:

- ReadWriteOnce

storageClassName: local-storage

volumeMode: Filesystem

volumeName: kafka-zookeeper-pv-0

resources:

requests:

storage: 50Gi

kubectl apply -f kafka-pvc.yaml -n default

注意:kafka-22716 为后面helm安装的名字,若helm安装时名字修改需要同步修改

3、执行helm安装

helm -n default install kafka-22716 bitnami/kafka --set externalAccess.enabled=true,externalAccess.service.type=NodePort,externalAccess.autoDiscovery.enabled=true,serviceAccount.create=true,rbac.create=true,replicaCount=3,auth.clientProtocol=sasl,auth.sasl.jaas.clientUsers=user,auth.sasl.jaas.clientPasswords=user@123,auth.sasl.interBrokerMechanism=PLAIN,auth.sasl.mechanisms="PLAIN\,SCRAM-SHA-256\,SCRAM-SHA-512",image.registry=harbor.test.com,image.repository=cmq/kafka,image.tag=2.4.1-debian-10-r43,zookeeper.image.registry=harbor.test.com,zookeeper.image.repository=cmq/zookeeper,zookeeper.image.tag=3.7.0-debian-10-r106,externalAccess.autoDiscovery.image.registry=harbor.test.com,externalAccess.autoDiscovery.image.repository=cmq/kubesphere-kubectl,externalAccess.autoDiscovery.image.tag=v1.91.1,nodeSelector="kubernetes.io/hostname: node-205"

4、获取kafak的nodeport

kubectl -n default get svc | grep kafka


http://www.kler.cn/a/415036.html

相关文章:

  • 微信小程序数据请求教程:GET与POST请求详解
  • 《Vue 数据绑定:开启动态页面之旅》
  • 计算机网络知识点极简总结
  • 常用元器件使用方法18:单节锂电池充电管理芯片XT4052的使用方法
  • vue3-setup基本使用(非响应式数据)
  • 虚拟机ubuntu-20.04.6-live-server搭建OpenStack:Victoria(一:工具、环境准备-controller node)
  • 高级java每日一道面试题-2024年11月25日-JVM篇-说说Java对象创建过程?
  • 前端安全和解决方案
  • 在Android上使用MD工业相机的开发示例
  • Rust学习笔记_03——元组
  • 【大模型】基于LLaMA-Factory的模型高效微调
  • 高效赋能游戏业务:全面解析游戏托管服务的价值与实践
  • 基于Java+SpringBoot+Mysql在线简单拍卖竞价拍卖竞拍系统功能设计与实现八
  • Vue3 常用指令解析:v-bind、v-if、v-for、v-show、v-model
  • uniapp对接蓝牙
  • 二刷代码随想录第16天
  • UE5 Switch Has Authority 节点
  • AI赋能电商:打造高效销售与卓越用户体验的新引擎
  • C语言第十三周课——重点考点知识
  • python实现TCP服务端,支持对所有客户端的数据收发,支持终端自定义命令操作,提供clear命令一键断开所有的客户端连接
  • 在 Spring Boot 中实现多种方式登录(用户名、手机号、邮箱等)的不正经指南
  • Hive构建日搜索引擎日志数据分析系统
  • 将excel文件中的信息读取后批量生成word文件
  • 鸿蒙ArkUI-X已更新适配API13啦
  • ubuntu中使用ffmpeg和nginx推http hls视频流
  • 网站怎么防御https攻击