kiwigrid/helm-charts

prometheus-thanos: compact produces broken yaml when no custom volumes are defined

Closed this issue · 0 comments

Version of Helm and Kubernetes:

Client Version: v1.17.2
Server Version: v1.14.9-eks-c0eccc

Which chart in which version:

prometheus-thanos - tested with versions 2.0.0 through 3.0.0

What happened:

When the user doesn't enable compact.persistentVolume or configure any volumes, the yaml generated for compact-statefulset is invalid and looks something like:

...
  template:
    metadata:
      ...
    spec:
      containers:
        - name: prometheus-thanos-compact
          imagePullPolicy: IfNotPresent
          image: ...
          args:
          - compat
            ...
          ports:
          - name: monitoring
            containerPort: 10902
          resources:
            ...
          volumeMounts:
            - mountPath: /data
              name: storage-volume
        - name: storage-volume
          emptyDir: {}

The same issue can show itself in various ways depending on the configuration options set. In my case, when I was setting compact.nodeSelector, helm was returning the following error:

YAML parse error on prometheus-thanos/templates/compact-statefulset.yaml: error converting YAML to JSON: yaml: line 62: did not find expected key

Inconsistent indentation in templates/compact-statefulset.yaml made it challenging to figure out what was the actual problem.