如何让领事在 Helm 中使用手动创建的 PersistentVolumeClaim

How to make consul to use manually created PersistentVolumeClaim in Helm

使用 Helm 安装 consul 时,它希望集群动态提供 consul-helm chart 请求的 PersistentVolume。这是默认行为。

我手动创建了 PV 和 PVC,需要使用这个 PV 供 consul-helm 图表使用。是否可以使用 helm 安装 consul 以在 kubernetes 中使用手动创建的 PV。

正如@coderanger所说

For this to be directly supported the chart author would have to provide helm variables you could set. Check the docs.

github 文档所示,没有变量可以改变它。


如果您必须更改它,则必须使用 consul-statefulset.yaml,此图表为创建的每个 statefulset pod 提供动态卷。

volumeMounts

volumeClaimTemplates

使用 helm fetch 将 consul 文件下载到本地目录

helm fetch stable/consul --untar

然后我找到了一个 很好的解释和例子,关于在 Statefulset 的所有副本中使用一个 PV 和 PVC,所以我认为它实际上可以在 consul chart 中工作。