banzai-charts icon indicating copy to clipboard operation
banzai-charts copied to clipboard

[thanos] rule-volume from configmap is not rendered correctly in rule-statefuleset template

Open michael-yxf opened this issue 4 years ago • 2 comments

Describe the bug when the rule component is enabled, the volume from configmap of thanos-rules is not rendered correctly in the rule-statefulset template. Check out this line: https://github.com/banzaicloud/banzai-charts/blob/master/thanos/templates/rule-statefulset.yaml#L132 {{- if empty .Values.rule.ruleOverrideName -}} The right-hand trimming-off should be removed, so it looks like this:

      - name: rule-volume
        configMap:
          {{- if empty .Values.rule.ruleOverrideName }}
          name: {{ include "thanos.fullname" . }}-rules
          {{- else }}
          name: {{ .Values.rule.ruleOverrideName }}
          {{- end }}

Steps to reproduce the issue:

$ helm template thanos -n monitoring -x templates/rule-statefulset.yaml --set rule.enabled=true

Check the last two lines for rule-volume in the output:

      - name: rule-volume
        configMap:name: monitoring-thanos-rules

Expected behavior The rule-volume from configmap should be rendered as below:

      - name: rule-volume
        configMap:
          name: monitoring-thanos-rules

Screenshots

Additional context The workaround is to specify the .Values.rule.ruleOverrideName value, however, with this .rule.ruleOverrideName value set, the configmap for the thanos-rules is not turned on, due to the condition for the configmap requiring the ruleOverrideName be empty: https://github.com/banzaicloud/banzai-charts/blob/master/thanos/templates/rule-configmap.yaml#L1

michael-yxf avatar Jul 20 '20 16:07 michael-yxf

Hello :) I have also an issue with rule-statefulset when I upgrade Thanos chart with the rule object enable, even without rulefiles.

Error: UPGRADE FAILED: YAML parse error on thanos/templates/rule-statefulset.yaml: error converting YAML to JSON: yaml: line 44: did not find expected key

I Don't kwow if t's related or if someone have encounter similar issue

LilaNKM avatar Aug 03 '20 13:08 LilaNKM

I'm also experiencing the same issue. I was able to work around it by changing indent to nindent

aclowkey avatar Jul 18 '21 06:07 aclowkey