-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[stable/prometheus]: add optional Prometheus StatefulSets #7116
[stable/prometheus]: add optional Prometheus StatefulSets #7116
Conversation
/assign @mgoodness |
Thanks for your PR @giacomoguiulfo. I'm wondering what's gonna happen to users that upgrade this chart, if they will loose all the data because the pvc and the deployment gone. Can you figure out this? |
@gianrubio Yes, this is a breaking change. If users upgrade to this chart, they will lose their data because when the deployment gets deleted, the PVC gets deleted too (and probably also because the template is gone), but again this is one reason of why we may want to migrate to StatefulSets. This is also why I bumped the version to |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statefulsets require a governing headless service. The service names should be specified in the statefulsets under spec.serviceName
.
/assign |
Thanks for the review @unguiculus. Just added the requested change. |
You simply configured the existing services as governing services for the statefulsets. These services are not headless. You need to create additional services. |
@unguiculus Just added new headless services as per request, leaving the existing ones untouched. |
cdbfe18
to
2be8dbd
Compare
2be8dbd
to
e4a7c58
Compare
@unguiculus Just rebased the PR! :) |
bd7f3e6
to
6e2cad5
Compare
/retest |
ping @gianrubio |
@gianrubio @unguiculus Any chance this can get in? Is there something else to work on? Thanks! |
/Lgtm /ok-to-test |
@unguiculus Could you take another look at this, please? It seems like it won't be merged because you requested changes. Thanks in advance 👍 |
/ok-to-test |
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giacomoguiulfo, gianrubio The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks @gianrubio! |
Signed-off-by: Giacomo Guiulfo <giacomoguiulfo@gmail.com> Signed-off-by: Chaoran Yu <yuchaoran2011@gmail.com>
Signed-off-by: Giacomo Guiulfo <giacomoguiulfo@gmail.com>
Signed-off-by: Giacomo Guiulfo <giacomoguiulfo@gmail.com>
What this PR does / why we need it:
Currently, the Prometheus chart uses Deployments to manage its server and alertmanager pods, and each one of them can be configured to use Persistent Volume Claims. However, it is bad practice (in this case, not always) to use Deployments to manage pods that deal with PVCs (#1863) because it might prevent them from having more than 1 replica (again, this is the case for Prometheus). Also, when deployments are deleted, (by default) the
PVCs
are automatically deleted with it. With statefulsets this doesn't happen (which is better if data wants to be persisted).This PR updates the chart to use StatefulSets instead of Deployments to manage the Prometheus server and alertmanager pods.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged):fixes #2346.
fixes #8026.
fixes #5115.