Home > Mobile >  Grafana Helm Chart on AWS EKS, using --set for multiple service annotations
Grafana Helm Chart on AWS EKS, using --set for multiple service annotations

Time:08-21

The grafana helm chart spawns a service on a Classic Load Balancer. I have the AWS load balancer webhook installed, and I'd like to overwrite the annotations on the Grafana service. I'm attempting the following:

helm install grafana grafana/grafana \
--namespace grafana \
--set persistence.storageClassName="gp2" \
--set persistence.enabled=true \
--set adminPassword='abc' \
--values grafana.yaml \
--set service.type=LoadBalancer \
--set nodeSelector.app=prometheus \
--set nodeSelector.k8s-app=metrics-server \
--set service.annotations."service\.beta.kubernetes\.io/aws-load-balancer-nlb-target-type"=ip \
--set service.annotations."service\.beta.kubernetes\.io/aws-load-balancer-type"=external

but, after trying multiple permutations, I continue to get:

Error: INSTALLATION FAILED: YAML parse error on grafana/templates/service.yaml: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into Go struct field .metadata.annotations of type string

What is the correct way of doing this?

CodePudding user response:

there is an issue in the annotation, you are missing escape character for beta\.kubernetes

try this and it should work.

--set service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-nlb-target-type"=ip \
--set service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-type"=external
  • Related