无法使用Helm在K8s集群上部署MariaDB。

huangapple go评论61阅读模式
英文:

Can't deploy the mariadb on k8s cluster with helm

问题

我正在学习Helm,并尝试在运行在DigitalOcean上的1个主节点和2个工作节点的Kubernetes集群上部署MariaDB,使用以下命令:

helm install my-mariadb bitnami/mariadb --version 12.2.2

这导致在集群上创建了多个资源,包括PersistenVolumeClaim,但它无法启动并陷入了等待状态,出现以下错误:没有可用于此声明的持久卷,并且没有设置存储类。这个错误也会导致所有的Pod都处于等待状态。

为什么会创建这个资源?在查看这个Helm chart的模板时,我甚至在这里找不到它的定义。

如果看不到它是正常的话,为什么在部署的资源中没有StorageClass或PersistentVolume?手动创建它们似乎不合适。

英文:

I'm in the process of learning helm and trying to deploy the mariadb on my k8s cluster running on the DigitalOcean with 1 master and 2 worker nodes with the following command:

helm install my-mariadb bitnami/mariadb --version 12.2.2

This in turn created multiple resources on the cluster including the PersistenVolumeClaim, which failed to spin up and gets stuck in the Pending state with the following error: no persistent volumes available for this claim and no storage class is set. This error in turn keeps all the pods being in the Pending state as well.

Why does this resource even gets created? After looking into the templates of this helm chart here I can't even find the definition of it there.

If that's actually fine that I can't see it, then why there's no StorageClass or PersistentVolume in deployed resources? Doesn't seem right to create them manually.

答案1

得分: 2

所以,事实证明这个问题只出现在使用kubeadm设置的k8s集群上。我已经通过按照评论中提供的链接创建自己的PersistentVolume和PersistentVolumeClaim来解决了这个问题,但随后遇到了另一个问题:mariadb pod的容器崩溃,因为它无法由于权限错误创建/bitnami/mariadb/data文件夹。

我能够在本地单节点的k8s集群上使其正常工作,而无需任何额外的步骤,因此决定放弃尝试在初始集群上解决这个问题,因为我只是为了学习而这样做。

英文:

So, turns out that this problem arise only on the k8s cluster that's set up with kubeadm. I've fixed this issue by creating my own PersistentVolume and PersistentVolumeClaim as described in the link provided in the comments, but then faced another problems: the mariadb pod's container crashes as it can't create /bitnami/mariadb/data folder due to permission error.

I was able to make this work on the local single-node k8s cluster without any additional steps and decided to abandon to try to resolve this issue on initial cluster, as I do this only for studying.

huangapple
  • 本文由 发表于 2023年5月28日 15:09:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76350349.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定