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] Add alertmanager persistentVolumeClaimRetentionPolicy #5078

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

aslafy-z
Copy link
Contributor

@aslafy-z aslafy-z commented Dec 19, 2024

What this PR does / why we need it

This PR exposes persistentVolumeClaimRetentionPolicy field of Alertmanager CRD resource. PersistentVolumeClaimRetentionPolicy is a feature introduced for StatefulSets (by default in K8s 1.27.0+), this feature lets us decide whether the StatefulSet should delete or retain it's corresponding PVC's it is deleted or scaled. It is particularly useful in environments where stale volumes can grow in amount, causing additional costs or clutter in general. The CRD field itself was added to Prometheus operator with prometheus-operator/prometheus-operator#7183 and released with https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.79.0, however not yet exposed in kube-prometheus-stack.

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

@aslafy-z aslafy-z changed the title (kube-prometheus-stack] add alertmanager persistentVolumeClaimRetentionPolicy [kube-prometheus-stack] add alertmanager persistentVolumeClaimRetentionPolicy Dec 19, 2024
@aslafy-z aslafy-z changed the title [kube-prometheus-stack] add alertmanager persistentVolumeClaimRetentionPolicy [kube-prometheus-stack] Add alertmanager persistentVolumeClaimRetentionPolicy Dec 19, 2024
@aslafy-z aslafy-z marked this pull request as ready for review December 19, 2024 10:10
…onPolicy

Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
Signed-off-by: GitHub <noreply@github.com>
@QuentinBisson
Copy link
Member

Could you hide this behind Capabilities.KubeVersion.Minor with version 1.32.0? This just got GA, I would rather not cause issues on existing deployments :)

@aslafy-z
Copy link
Contributor Author

aslafy-z commented Dec 19, 2024

@QuentinBisson this just went GA but is enabled by default since its Beta phase, in 1.27.
image

@QuentinBisson
Copy link
Member

Oh yes you're right. Can you flag it for 1.27 to be safe ? I would assume we have people running out in later clusters

@aslafy-z
Copy link
Contributor Author

aslafy-z commented Dec 19, 2024

@QuentinBisson I beleive this was already discussed at #4570 (comment). As the persistentVolumeClaimRetentionPolicy default value is falsy ({}), it will not be set in the statefulset spec without someone explicitly setting it. What do you think?

@QuentinBisson
Copy link
Member

Oh my apologies, I was not aware of it :D

Then yes, its good, let's merge it. Thank you for putting through with me today :P and for your work on this PR

@QuentinBisson QuentinBisson merged commit d67d71c into prometheus-community:main Dec 19, 2024
4 checks passed
@aslafy-z aslafy-z deleted the patch-1 branch December 19, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants