Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAuto scaling issue with Prometheus container #2609
Comments
This comment has been minimized.
This comment has been minimized.
|
Does those auto-scaled prometheus use the same PVC ? |
This comment has been minimized.
This comment has been minimized.
|
yes. And in latest version also, same issue...
|
This comment has been minimized.
This comment has been minimized.
|
So you are trying to run two Prometheus on the same data directory. If you want to scale you need to give each Prometheus instance a different directory. In Prometheus scaling is done via Federation: https://prometheus.io/docs/operating/federation/ |
This comment has been minimized.
This comment has been minimized.
|
That's the challenge. Because container are immutable. For any reason it may die. Till that time another container start my monitoring data lost. If I have another container running with same data then there is nothing to lose of monitoring data. I can not use different folder for other container Please advise. |
This comment has been minimized.
This comment has been minimized.
|
For HA of Prometheus you can run two "independent" (As in on different folders/machines) Prometheuses which scrape the same targets. If one containers goes down, you can switch to the other without any loss. See: https://prometheus.io/docs/introduction/faq/#can-prometheus-be-made-highly-available |
This comment has been minimized.
This comment has been minimized.
|
That mean when two containers running, both have same data. In kubernetes cluster we are not doing any manual switching, that is taken care by kubernetes itself. I think due to present of database inside prometheus container its not allowing scale up with same pvc. If my understanding is correct then need to rethink on this. |
This comment has been minimized.
This comment has been minimized.
|
As both Prometheuses are scraping the same targets, they hold more or less the same data. |
This comment has been minimized.
This comment has been minimized.
|
Prometheus act as a stateful application, two instance can't use the same data directory. |
This comment has been minimized.
This comment has been minimized.
|
You either want to look at using StatefulSets, which allow templating of PVCs that are instantiated dynamically or try out the prometheus-operator which handles a lot of those things for you. |
This comment has been minimized.
This comment has been minimized.
|
By the way in prometheus container which folders need setup for Persistent Volume. I use /var folder from container. |
prasenforu
closed this
Apr 20, 2017
josdotso
referenced this issue
Nov 10, 2017
Closed
Prometheus PVC support for more than one replica or Statefulset #2346
This comment has been minimized.
This comment has been minimized.
empyrean987
commented
Jun 27, 2018
|
@prasenforu did you ever solve this issue? |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
prasenforu commentedApr 11, 2017
I am using Prometheus in kubernetes cluster using PVC (Persistent Volume Claim).
As single container its working fine but when I was trying to do autoscaling.
Its going to "CrashLoopBackOff" and in container logs I am getting following error