从helm命令行设置嵌套数据结构? [英] Setting nested data structures from helm command line?

查看:80
本文介绍了从helm命令行设置嵌套数据结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在安装 prometheus-redis-exporter Helm图表.其 Deployment 对象具有一种注入注释的方式:

I'm installing the prometheus-redis-exporter Helm chart. Its Deployment object has a way to inject annotations:

# deployment.yaml
...
  template:
    metadata:
      annotations:
{{ toYaml .Values.annotations | indent 8 }}

通常,如果我提供值文件,则可以这样做:

Typically if I was providing a values file, I could just do this:

# values.yaml
annotations:
  foo: bar
  bash: baz

然后使用以下命令安装图表:

And then install the chart with:

helm install --values values.yaml

但是,在某些情况下,对我来说,在命令行上使用-set 指定这些值更为简单,我只是不确定如何指定这样的嵌套集

However, in some cases it is more simple for me to specify these values on the command line with --set instead, I'm just not sure how I would specify a nested set like that.

在命令行上安装头盔图表时,如何设置上面的 annotations 对象:

How can I set the above annotations object when installing a helm chart on the commandline:

helm install --set <what_goes_here>

推荐答案

helm 文档有一个

The helm docu has a section The Format and Limitations of --set, which contains what you are looking for.

-设置external.inner = value 会导致:

outer:
  inner: value

因此,您的整个 helm 命令如下所示:

Therefore your whole helm command looks like this:

helm install --set annotations.foo=bar,annotations.bash=baz stable/prometheus-redis-exporter

这篇关于从helm命令行设置嵌套数据结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆