volume and volumemount in Prometheus are not applying?Installed Prometheus-operator using helm chart

7/30/2020

Used this values.yaml for Prometheus-operator helm chart

prometheus-operator:
  fullnameOverride: prometheus-operator
  prometheusOperator:
    resources:
      limits:
        memory: 192Mi
      requests:
        memory: 128Mi
  prometheus:
    prometheusSpec:
      fullnameOverride: prometheus
      routePrefix: /prometheus
      externalUrl: https://prometheus:8443/prometheus/
      retention: 30d
      serviceMonitorSelectorNilUsesHelmValues: false
      resources:
        limits:
          memory: 2.0Gi 
        requests:
          memory: 1.7Gi   
      storageSpec:
        volumeClaimTemplate:
          spec:
            selector:
              matchLabels:
                app: my-example-prometheus
            resources:
              requests:
                storage: 1Gi

      volumes:
      - emptyDir: {}
        name: config-vol
      volumeMounts: 
      - mountPath: /etc/prometheus/config_vol
        name: config-vol

volume and volumemount in Prometheus are not applying?Installed by providing the dependency in chart.yaml file provided below and by above values.yaml file.

dependencies:
- name: prometheus-operator
  version: "8.13.12"
  condition: prometheus-operator.create
  repository: https://kubernetes-charts.storage.googleapis.com

To reproduce this issue install Prometheus-operator with this dependency in chart.yaml and values.yaml and see whether volume and volumeMount provided in values.yaml are applied or not. There is no such error prometheus-operator is in running state but volume and volumeMount are not get applied.

-- Nikhil Pawar
kubernetes
kubernetes-helm
prometheus-operator

1 Answer

8/3/2020

It looks like the volume feature is available since version 8.13.13 of the prometheus operator. Here`s the commit reference:

`prometheus.prometheusSpec.volumes` | Additional Volumes on the output StatefulSet definition. | `[]` |

`prometheus.prometheusSpec.volumeMounts` | Additional VolumeMounts on the output StatefulSet definition. | `[]` |

Please update your operator to newer version.

-- acid_fuji
Source: StackOverflow