Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] way to use hostpath as /prometheus storage #4416

Open
yjagdale opened this issue Apr 4, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@yjagdale
Copy link

yjagdale commented Apr 4, 2024

Describe the bug a clear and concise description of what the bug is.

Hello,

I am trying to mount /prometheus to hostpath (/storage) to use as persistent volume in my onprem cluster.

Issue is when I set persistence as of, /Prometheus is being mounted to empty directory which doesn't allow me to mount by using volumes and volume mounts way.

What's your helm version?

version.BuildInfo{Version:"v3.14.3", GitCommit:"f03cc04caaa8f6d7c3e67cf918929150cf6f3f12", GitTreeState:"clean", GoVersion:"go1.22.1"}

What's your kubectl version?

Client Version: v1.29.1 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.27.12+rke2r1 WARNING: version difference between client (1.29) and server (1.27) exceeds the supported minor version skew of +/-1

Which chart?

kube-prometheus-stack

What's the chart version?

57.2.0

What happened?

I set persistence as of, /Prometheus is being mounted to empty directory which doesn't allow me to mount by using volumes and volume mounts way.

What you expected to happen?

should have way to disable empty directory mount.

How to reproduce it?

you can run helm chart with following values to reproduce

        prometheus:
          prometheusSpec:
            volumes:
            - name: prometheus-storage
              hostPath:
                path: /mnt/databahn/prometheus
                
            volumeMounts:
            - name: prometheus-storage
              mountPath: /prometheus

Enter the changed values of values.yaml?

    prometheus:
      prometheusSpec:
        volumes:
        - name: prometheus-storage
          hostPath:
            path: /mnt/databahn/prometheus
            
        volumeMounts:
        - name: prometheus-storage
          mountPath: /prometheus

Enter the command that you execute and failing/misfunctioning.

using helmfile to install the chart

Anything else we need to know?

No response

@yjagdale yjagdale added the bug Something isn't working label Apr 4, 2024
@zeritti zeritti changed the title [prometheus-kube-stack] way to use hostpath as /prometheus storage [kube-prometheus-stack] way to use hostpath as /prometheus storage Apr 6, 2024
@zeritti
Copy link
Member

zeritti commented Apr 6, 2024

You should use prometheus.prometheusSpec.storageSpec (values' StorageSpec) for specifying Prometheus' data storage. See also prometheus CRD's StorageSpec. For more information on storage, see storage user guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants