[英]How to pass the content of a file to Helm values.yaml
I want to use Helm chart of RabbitMQ to set up a cluster but when I try to pass the configuration files that we have at the moment to the values.yaml it doesn't work.我想使用 RabbitMQ 的 Helm chart 来设置集群,但是当我尝试将我们目前拥有的配置文件传递给 values.yaml 时,它不起作用。
The command that I use:我使用的命令:
helm install --dry-run --debug stable/rabbitmq --name testrmq --namespace rmq -f rabbit-values.yaml
rabbit-values.yaml:兔子值.yaml:
rabbitmq:
plugins: "rabbitmq_management rabbitmq_federation rabbitmq_federation_management rabbitmq_shovel rabbitmq_shovel_management rabbitmq_mqtt rabbitmq_web_stomp rabbitmq_peer_discovery_k8s"
advancedConfiguration: |-
{{ .Files.Get "rabbitmq.config" | quote}}
And what I get for advancedConfiguration
:我从
advancedConfiguration
得到了什么:
NAME: testrmq
REVISION: 1
RELEASED: Thu Aug 29 10:09:26 2019
CHART: rabbitmq-5.5.0
USER-SUPPLIED VALUES:
rabbitmq:
advancedConfiguration: '{{ .Files.Get "rabbitmq.config" | quote}}'
plugins: rabbitmq_management rabbitmq_federation rabbitmq_federation_management
rabbitmq_shovel rabbitmq_shovel_management rabbitmq_mqtt rabbitmq_web_stomp rabbitmq_peer_discovery_k8s
I have to mention that:我不得不提的是:
indent 4
)indent 4
)You can't use Helm templating in the values.yaml
file.您不能在
values.yaml
文件中使用 Helm 模板。 (Unless the chart author has specifically called the tpl
function when the value is used; for this variable it doesn't , and that's usually called out in the chart documentation.) (除非图表作者在使用该值时专门调用了
tpl
函数;对于这个变量, 它没有,这通常在图表文档中被调用。)
Your two options are to directly embed the file content in the values.yaml
file you're passing in, or to use the Helm --set-file
option (link to v2 docs).您的两个选项是直接将文件内容嵌入到您传入的
values.yaml
文件中,或者使用Helm --set-file
选项(链接到 v2 文档)。
helm install --dry-run --debug \
stable/rabbitmq \
--name testrmq \
--namespace rmq \
-f rabbit-values.yaml \
--set-file rabbitmq.advancedConfig=rabbitmq.config
There isn't a way to put a file pointer inside your local values YAML file though.但是,没有办法将文件指针放入本地值 YAML 文件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.