helm命令部署etcd

部署在etcd-n命名空间下

helm search repo etcd

helm配置 Chart 仓库

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add azure http://mirror.azure.cn/kubernetes/charts
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo update   # 类似 yum update

查看配置的存储库

helm repo list

helm repo remove aliyun   # 移除指定的存储库aliyun

部署etcd

1、查询 etcd 资源

$ helm repo update
$ helm search repo etcd

2、下载安装包至本地,chart的版本9.12.0 (3.5.12)

$ helm pull bitnami/etcd --version=9.12.0

# 解压缩安装包
$ tar xf etcd-9.12.0.tgz

# 修改values.yaml文件
$ cd etcd
$ cp values.yaml values.yaml.bak 
$ vim values.yaml

# 查看配置文件
$ grep -Ev "$^|#" values.yaml

# 查看集群 storageclasses
$ kubectl get sc

3、修改配置文件

$ vim values.yaml 

global:
  # 定义 storageClass 使用的类型
  storageClass: "managed-nfs-storage"

# 定义 mongodb 集群为副本集模式
architecture: replicaset

# 启动集群认证功能,设置超级管理员账户密码
auth:
  rbac:
    create: true
    allowNoneAuthentication: true
    rootPassword: "123456"


# 设置集群数量,3个
replicaCount: 3

# 启用持久化存储,使用 global.storageClass 自动创建 pvc 
persistence:
  enabled: true
  size: 20Gi

service:
  ## @param service.type Kubernetes Service type
  ##
  type: NodePort

4、安装etcd

# 进入etcd的上级目录执行
helm install etcd etcd/ -n etcd-n

# 更新
helm upgrade etcd etcd/ -n etcd-n

查看部署的 etcd 集群
$ kubectl describe pod -n etcd-n
$ kubectl get pod -n etcd-n
$ helm -n etcd-n
 list
查看服务使用的 storageclass
# 查看 pvc
$ kubectl -n etcd-n get pvc

# 查看 pv
$ kubectl get pv
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐