Skip to content

Commit

Permalink
[prometheus-push-gateway] Add lifecycle hooks
Browse files Browse the repository at this point in the history
Fixes prometheus-community#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`

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/prometheus-community/helm-charts/issues/5102?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
duncaan committed Dec 29, 2024
1 parent 5710cd2 commit 72a45c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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 72a45c6

Please sign in to comment.