我正在安装prometheus-redis-exporter Helm chart。它的Deployment
对象有一种注入注释的方法:
# deployment.yaml
...
template:
metadata:
annotations:
{{ toYaml .Values.annotations | indent 8 }}
通常,如果我提供值文件,我可以这样做:
# values.yaml
annotations:
foo: bar
bash: baz
然后安装图表:
helm install --values values.yaml
但是,在某些情况下,使用--set
在命令行上指定这些值更简单,我只是不确定如何指定这样的嵌套集。
在命令行上安装helm图表时,如何设置上面的annotations
对象:
helm install --set <what_goes_here>
helm
文档有一个The Format and Limitations of --set部分,其中包含您正在寻找的内容。
--set outer.inner=value
导致:
outer:
inner: value
因此,您的整个helm
命令如下所示:
helm install --set annotations.foo=bar,annotations.bash=baz stable/prometheus-redis-exporter