国内 Kubernetes(1.28.2) 集群部署 OpenEBS(3.10.0)

本文遵照 OpenEBS 官方文档安装,存储引擎采用Jiva。文章不会再重复介绍官网的安装流程,着重说明可能遇到的问题。

在运行 helm install openebs openebs/openebs时,可能会遇到这样一个错误:

Error: INSTALLATION FAILED: Get "https://github.com/openebs/charts/releases/download/openebs-3.10.0/openebs-3.10.0.tgz": unexpected EOF

这是由于 openebs 的 helm chart 有点大,国内容易下载失败。可以手动wget解决:

wget https://github.com/openebs/charts/releases/download/openebs-3.10.0/openebs-3.10.0.tgz
# 如果无法从github之间下载考虑使用ghproxy镜像加速
wget https://mirror.ghproxy.com/github.com/openebs/charts/releases/download/openebs-3.10.0/openebs-3.10.0.tgz
# 又或者使用helm pull
helm pull openebs/openebs --untar -d $YOUR_DIR

helm install openebs ./openebs-3.10.0.tgz

接下来,在 install 之后,会发现许多容器无法启动。

这是由于Jiva默认需要下载许多registry.k8s.io的镜像(Image)。这里需要修改默认的 helm values:

# 配置文件参考 Helm 仓库说明
# https://openebs.github.io/jiva-operator/
jiva:
  enabled: true
  replicas: 1
  image: "docker.mirrors.sjtug.sjtu.edu.cn/openebs/jiva"
  defaultStoragePath: "/var/openebs"
  csiController:
    driverRegistrar:
      image:
        registry: k8s.mirror.nju.edu.cn/
        repository: sig-storage/csi-node-driver-registrar
        tag: v2.10.0
    resizer:
      image:
        registry: k8s.mirror.nju.edu.cn/
        repository: sig-storage/csi-resizer
        tag: v1.8.0
    attacher:
      image:
        registry: k8s.mirror.nju.edu.cn/
        repository: sig-storage/csi-attacher
        tag: v4.3.0
    provisioner:
      image:
        registry: k8s.mirror.nju.edu.cn/
        repository: sig-storage/csi-provisioner
        tag: v3.6.3

    livenessprobe:
      image:
        registry: k8s.mirror.nju.edu.cn/
        repository: sig-storage/livenessprobe
        tag: v2.10.0

  csiNode:
    livenessprobe:
      image:
        registry: k8s.mirror.nju.edu.cn/
        repository: sig-storage/livenessprobe
        tag: v2.10.0
    driverRegistrar:
      image:
        registry: k8s.mirror.nju.edu.cn/
        repository: sig-storage/csi-node-driver-registrar
        tag: v2.10.0

  jivaOperator:
    controller:
      image:
        registry: "docker.mirrors.sjtug.sjtu.edu.cn/"
        repository: openebs/jiva
    replica:
      image:
        registry: "docker.mirrors.sjtug.sjtu.edu.cn/"
        repository: openebs/jiva
    image:
      registry: "docker.mirrors.sjtug.sjtu.edu.cn/"
      repository: openebs/jiva-operator

  jivaCSIPlugin:
    image:
      registry: "docker.mirrors.sjtug.sjtu.edu.cn/"
      repository: openebs/jiva-csi

我们使用docker.mirrors.sjtug.sjtu.edu.cn/k8s.mirror.nju.edu.cn/分别对docker.ioregistry.k8s.io做镜像加速。docker.io并非必须,国内也可以访问,只是镜像下载速度非常慢。而registry.k8s.io在国内完全无法访问,必须使用其他国内镜像源。

这份 values 需要格外注意csiControllercsiNode指定的镜像都写了tag。 这是由于OpenEBS默认的版本都非常低,而这个版本需要根据你的Kubernetes版本选择。 相关镜像版本及其支持的Kubernetes列表请查看Kubernetes CSI 官网文档

加我微信,成为我的朋友wechat
Copyright © 2018 val-istar-guo.com All rights reserved苏ICP备2023015265号