Skip to content

Commit

Permalink
[prometheus-push-gateway] Add lifecycle hooks
Browse files Browse the repository at this point in the history
Fixes #5102

Add support for lifecycle hooks in the push-gateway deployment.

* Add lifecycle hooks configuration to `charts/prometheus-pushgateway/templates/deployment.yaml`
* Add lifecycle hooks configuration to `charts/prometheus-pushgateway/templates/statefulset.yaml`
* Add lifecycle hooks configuration options in `charts/prometheus-pushgateway/values.yaml`

Signed-off-by: Duncan Schulze <[email protected]>
  • Loading branch information
duncaan committed Dec 29, 2024
1 parent 5710cd2 commit aeea100
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/prometheus-pushgateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "v1.10.0"
description: A Helm chart for prometheus pushgateway
name: prometheus-pushgateway
version: 2.15.0
version: 2.16.0
home: https://github.com/prometheus/pushgateway
sources:
- https://github.com/prometheus/pushgateway
Expand Down
2 changes: 2 additions & 0 deletions charts/prometheus-pushgateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ spec:
{{- include "prometheus-pushgateway.defaultLabels" . | nindent 8 }}
spec:
{{- include "prometheus-pushgateway.podSpec" . | nindent 6 }}
lifecycle:
{{- toYaml .Values.lifecycle | nindent 8 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/prometheus-pushgateway/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
{{- include "prometheus-pushgateway.defaultLabels" . | nindent 8 }}
spec:
{{- include "prometheus-pushgateway.podSpec" . | nindent 6 }}
lifecycle:
{{- toYaml .Values.lifecycle | nindent 8 }}
{{- if .Values.persistentVolume.enabled }}
volumeClaimTemplates:
- metadata:
Expand Down
6 changes: 6 additions & 0 deletions charts/prometheus-pushgateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,9 @@ networkPolicy: {}
# Array of extra K8s objects to deploy (evaluated as a template)
# The value can hold an array of strings as well as objects
extraManifests: []

# Lifecycle hooks configuration
lifecycle: {}
# preStop:
# exec:
# command: ["/bin/sh", "-c", "sleep 30"]

0 comments on commit aeea100

Please sign in to comment.