Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Up Annotations (key has no value error) #883

Closed
pen-pal opened this issue Jun 13, 2022 · 2 comments · Fixed by #927
Closed

Setting Up Annotations (key has no value error) #883

pen-pal opened this issue Jun 13, 2022 · 2 comments · Fixed by #927

Comments

@pen-pal
Copy link

pen-pal commented Jun 13, 2022

Question

Hi, I am trying to deploy grafana and prometheus helm chart using terraform. I am facing issue while trying to setup annotations for ingress controller.
Here is the configuration I am using

resource "helm_release" "monitoring-stack" {
  count            = var.create_monitoring_stack ? 1 : 0
  name             = "monitor"
  repository       = "https://prometheus-community.github.io/helm-charts"
  chart            = "kube-prometheus-stack"
  version          = "35.5.1"
  namespace        = local.namespace
  create_namespace = true

  values = [
    "${file(".${path.module}/values/grafana-values.yaml")}"
  ]

  set {
    name  = "grafana.ingress.enabled"
    value = "true"
  }

  set {
    name  = "grafana.ingress.hosts"
    value = "[${var.monitor_host}]"
  }

  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/group.name:shared-ingress"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/healthcheck-path:/health"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/success-codes:200"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/listen-ports:'[{\"HTTP\":80},{\"HTTPS\":443}]'"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/load-balancer-attributes:deletion_protection.enabled=true"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/scheme:internet-facing"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "kubernetes.io/ingress.class:alb"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/certificate-arn:${var.certificate_arn}"
  }
  set {
    name  = "grafana.ingress.annotations"
    value = "alb.ingress.kubernetes.io/target-type:ip"
  }
}

What is the issue?

When running the apply, it is failing with the following error

Error: failed parsing key "grafana.ingress.annotations" with value alb.ingress.kubernetes.io/listen-ports:'[{"HTTP":80},{"HTTPS":443}]', key "{\"HTTPS\":443}]'" has no value

I tried escaping with \ and : itself, but nothing seems to work.

Would appreciate your help on this. Thank You.

@pen-pal pen-pal changed the title Setting Up Annotations Setting Up Annotations (key has no value error) Jun 13, 2022
@BBBmau
Copy link
Contributor

BBBmau commented Jun 15, 2022

Hello! You'll need to double escape like this:

set {
    name  = "grafana.ingress.annotations\\.alb\\.ingress\\.kubernetes\\.io/group\\.name"
    value = "shared-ingress"
}

We'll be updating the documentation for set to make this clearer

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants