“0/1 nodes are available: pod has unbound immediate PersistentVolumeClaims” error using microk8s

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

"0/1 nodes are available: pod has unbound immediate PersistentVolumeClaims" error using microk8s

问题

By using the Helm chart of EMQX Operator (https://github.com/emqx/emqx-operator) and following their guide (https://github.com/emqx/emqx-operator/blob/main/docs/en_US/tasks/configure-emqx-persistence.md) on how to set up data persistence, I encountered the error mentioned in the following question.

我使用 EMQX Operator 的 Helm 图表 (https://github.com/emqx/emqx-operator),并按照他们的指南 (https://github.com/emqx/emqx-operator/blob/main/docs/en_US/tasks/configure-emqx-persistence.md) 配置数据持久性时,遇到了在以下问题中提到的错误。

英文:

by using the helm chart of emqx operator(https://github.com/emqx/emqx-operator) and going to follow their guide (https://github.com/emqx/emqx-operator/blob/main/docs/en_US/tasks/configure-emqx-persistence.md) on how to set data persistence I get the error given in the following question.

I did exactly as described in the guide, but precisely I get the error reported in relation to emqx-core.

Moreover, By doing:

kubectl get sc

I get the following output:

NAME    PROVISIONER    RECLAIMPOLICY    VOLUMEBINDINGMODE    ALLOWVOLUMEEXPANSION
microk8s-hostpath (default)   microk8s.io/hostpath   Delete   WaitForFirstConsumer   false

Note: I use the APIVersion apps.emqx.io/v2alpha1

答案1

得分: 0

apiVersion: apps.emqx.io/v2alpha1
kind: EMQX
metadata:
  name: emqx
spec:
  image: emqx:5.0
  coreTemplate:
    spec:
      volumeClaimTemplates:
        storageClassName: microk8s-hostpath
        resources:
          requests:
            storage: 20Mi
        accessModes:
        - ReadWriteOnce
      replicas: 3

你可以尝试上面的YAML配置。

英文:
apiVersion: apps.emqx.io/v2alpha1
kind: EMQX
metadata:
  name: emqx
spec:
  image: emqx:5.0
  coreTemplate:
    spec:
      volumeClaimTemplates:
        storageClassName: microk8s-hostpath
        resources:
          requests:
            storage: 20Mi
        accessModes:
        - ReadWriteOnce
      replicas: 3

You can try the above yaml configuration.

huangapple
  • 本文由 发表于 2023年4月6日 23:46:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951409.html
匿名

发表评论

匿名网友

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

确定