For example, set alertmanager.ingress.annotations
to add two items, both of these two methods not work:
$ helm install stable/prometheus \
--set alertmanager.ingress.enabled=true \
--set "alertmanager.ingress.annotations={alb.ingress.kubernetes.io/scheme: internet-facing, alb.ingress.kubernetes.io/tags: Environment=dev,Team=test}"
Error: YAML parse error on prometheus/templates/alertmanager-ingress.yaml: error unmarshaling JSON: json: cannot unmarshal array into Go struct field .annotations of type map[string]string
$ helm install stable/prometheus \
--set alertmanager.ingress.enabled=true \
--set "alertmanager.ingress.annotations={'alb.ingress.kubernetes.io/scheme': 'internet-facing', 'alb.ingress.kubernetes.io/tags': 'Environment=dev,Team=test'}"
Error: YAML parse error on prometheus/templates/alertmanager-ingress.yaml: error unmarshaling JSON: json: cannot unmarshal array into Go struct field .annotations of type map[string]string
So how to use it?
You want to achieve the following (cut from values.yaml
from prometheus
helm chart):
alertmanager:
ingress:
## If true, alertmanager Ingress will be created
##
enabled: true
## alertmanager Ingress annotations
##
annotations: {
alb.ingress.kubernetes.io/scheme: internet-facing,
alb.ingress.kubernetes.io/tags: 'Environment=dev,Team=test'
}
According to helm documentation, the structure:
alertmanager:
ingress:
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
is
--set alertmanager.ingress.annotations."alb\.ingress\.kubernetes\.io/scheme"=internet-facing
If you want to add one more annotation, it will be one more --set
statement:
--set alertmanager.ingress.annotations."alb\.ingress\.kubernetes\.io/tags"="Environment=dev\,Team=test"
And one more thing, name: "value1,value2"
is --set name=value1\,value2
, so Environment=dev,Team=test
is "Environment=dev\,Team=test"
.
The final helm command is:
helm install stable/prometheus --set alertmanager.ingress.enabled=true --set alertmanager.ingress.annotations."alb\.ingress\.kubernetes\.io/scheme"=internet-facing --set alertmanager.ingress.annotations."alb\.ingress\.kubernetes\.io/tags"="Environment=dev\,Team=test"
p.s. Above command fails, because you need to specify domain name for alertmanager as well. The correct one is:
helm install stable/prometheus --set alertmanager.ingress.enabled=true --set alertmanager.ingress.annotations."alb\.ingress\.kubernetes\.io/scheme"=internet-facing --set alertmanager.ingress.annotations."alb\.ingress\.kubernetes\.io/tags"="Environment=dev\,Team=test" --set alertmanager.ingress.hosts[0]=alertmanager.domain.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With