使用operator部署有状态的服
operator更适合部署有状态的服务
1.了解你要部署的服务
2.去github和operatorhub上搜。https://operatorhub.io/
3.安装部署
使用henl来管理中间件
Helm来管理包的时候需要安装客户端工具:https://heml.sh/docs/intro/install/
heml Charts仓库:https://artifacthub.io/
添加bitnami和官方henl仓库:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add stable https://charts.helm.sh/stable
安装方式一:先下载后安装
很多镜像都是在公网下载比较困难,需要先将镜像同步到镜像仓库后,再去修改vaules.yaml文件里面的镜像地址。需要修改的配置可以根据直接部署的set命令对应的参数来修改。
helm pull bitnami/zookeeper
修改values.yaml相应配置:副本数、auth、持久化
helm install -n public-service zookeper .
直接安装
helm install kafka bitnami/kafka --set zookeeper.enable=false --set replicaCount=3 --set externalZookeeper.servers=zookeeper --set persistence.enabled=false -n public-service
基础命令
helm search 查询一个包
helm search repo bitnami/redis
helm pull 下载安装包
helm pull bitnami/kafka
helm create 创建一个包
helm create 程序名称
helm install 安装包
helm install -n public-service kafka .
helm list 查看安装包 有命名空间隔离
helm list -n public-service
helm upgrade 跟新程序
helm upgrade -n public-service kafka .
helm delete 删除安装程序
helm delete -n public-service kafka .