bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.03k stars 9.22k forks source link

[bitnami/redis-cluster] Error when installing with prometheusRule additionalLabels #2426

Closed rechandler12 closed 4 years ago

rechandler12 commented 4 years ago

Which chart: redis-cluster:2.0.9

Describe the bug When install chart with following values.yaml:

metrics:
  prometheusRule:
    enabled: true
    additionalLabels:
      prometheus: doks-cluster-monitoring
    rules:
      - alert: RedisDown
        expr: redis_up{service="{{ template "redis-cluster.fullname" . }}-metrics"} == 0
        for: 5m
        labels:
          severity: error
        annotations:
          summary: Redis instance {{ "{{ $labels.instance }}" }} down
          description: Redis instance {{ "{{ $labels.instance }}" }} is down

I've got error:

Error: YAML parse error on redis-cluster/templates/prometheusrule.yaml: error converting YAML to JSON: yaml: line 9: mapping values are not allowed in this context

To Reproduce Steps to reproduce the behavior:

  1. Create values.yaml with content:
    metrics:
    prometheusRule:
    enabled: true
    additionalLabels:
      prometheus: doks-cluster-monitoring
    rules:
      - alert: RedisDown
        expr: redis_up{service="{{ template "redis-cluster.fullname" . }}-metrics"} == 0
        for: 5m
        labels:
          severity: error
        annotations:
          summary: Redis instance {{ "{{ $labels.instance }}" }} down
          description: Redis instance {{ "{{ $labels.instance }}" }} is down
  2. Install chart with helm install -f https://raw.githubusercontent.com/bitnami/charts/master/bitnami/redis-cluster/values-production.yaml -f values.yaml redis bitnami/redis-cluster
  3. See error

Expected behavior No error

Version of Helm and Kubernetes:

version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"}
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.3", GitCommit:"06ad960bfd03b39c8310aaf92d1e7c12ce618213", GitTreeState:"clean", BuildDate:"2020-02-11T18:14:22Z", GoVersion:"go1.13.6", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.6", GitCommit:"72c30166b2105cd7d3350f2c28a219e6abcd79eb", GitTreeState:"clean", BuildDate:"2020-01-18T23:23:21Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
marcosbc commented 4 years ago

Thank you for reporting this! I could reproduce it and created PR #2445 to fix this issue.