0

I've installed kube-prometheus-stack with Helm. Everything works out of the box.

Now, how do I specify volumes/pvc for my Prometheus and Grafana instances using Helm values? I followed the documentation and none of the procedures described there work.

Normally, I start Prometheus with this manifest:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ${K8S_DEPLOYMENT_NAME}
  labels:
    app.kubernetes.io/name: ${K8S_DEPLOYMENT_NAME}
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: ${K8S_DEPLOYMENT_NAME}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: ${K8S_DEPLOYMENT_NAME}
    spec:
      hostname: ${K8S_DEPLOYMENT_NAME}
      containers:
      - image: ${K8S_IMAGE_NAME}
        name:  ${K8S_DEPLOYMENT_NAME}
        ports:
        - containerPort: ${APP_PORT}
          protocol: TCP
        volumeMounts:
        - mountPath: /prometheus/persistent
          name: sk-prometheus-pvc
      volumes:
      - name: sk-prometheus-pvc
        persistentVolumeClaim:
          claimName: sk-prometheus-pvc

How do I achieve the same config with kube-prometheus-stack Helm?

  • I tried playing with prometheus.prometheusSpec.storageSpec.volumeClaimTemplate -- didn't work. It creates some PVC, but never attaches Prometheus pod to it
  • I also tried prometheus.prometheusSpec.volumes and prometheus.prometheusSpec.volumeMounts -- same result
David Maze
  • 130,717
  • 29
  • 175
  • 215

0 Answers0