需要说明:使用 Helm 图表在具有持久卷的本地设置中安装 ELK 堆栈

Need instruction : To Install ELK stack in On-Prem setup with persistant Volumes using Helm charts

我在设置 ELK 堆栈以监控我的 kubernetes 集群时需要有关设置持久卷的帮助。

我累了

helm install elasticsearch elasticsearch
错误 : 0/2 个节点可用:2 个 pod 具有未绑定的即时 PersistentVolumeClaims。

但是因为我在 prem 上运行,所以持久性 voumles 没有被创建。我如何在 helm install 命令中指定持久卷?

乍一看 through the chart,它似乎在您的 Statefulset 中使用了 Persistent Volume Claim Templates。

The volumeClaimTemplates will provide stable storage using PersistentVolumes provisioned by a PersistentVolume Provisioner.

图表检查是否 persistence.labels.enabled is True, and if it is it adds your labels, and then it adds your annotations, and then finally it uses your .Values.volumeClaimTemplate。因此,最后,如果您不更改值中的任何内容,它看起来会尝试使用您的默认配置程序创建具有这些规范的持久卷:

volumeClaimTemplate:
  accessModes: [ "ReadWriteOnce" ]
  resources:
    requests:
      storage: 30Gi

因此,您应该检查您的默认供应商是什么

kubectl get storageclasses

例如,我的是 aws-ebs,因此在我的例子中,它将创建 AWS EBS 卷。本文档解释了 how to change your Default storage class 如果您的未设置为您想要的设置。

Depending on the installation method, your Kubernetes cluster may be deployed with an existing StorageClass that is marked as default. This default StorageClass is then used to dynamically provision storage for PersistentVolumeClaims that do not require any specific storage class. See PersistentVolumeClaim documentation for details

您还应该能够指定要使用的存储 Class,然后在单独的值文件中传入如下内容:

volumeClaimTemplate:
  accessModes: [ "ReadWriteOnce" ]
  storageClassName: "my-storage-class"
  resources:
    requests:
      storage: 30Gi
helm install --name elasticsearch elastic/elasticsearch -f values.yaml -f custom-values.yaml