From 0529c1011be5ffd26419ef941920368ebdc2ee6f Mon Sep 17 00:00:00 2001 From: Stefan Andres <2674469+stefanandres@users.noreply.github.com> Date: Sun, 13 Oct 2024 06:29:49 +0200 Subject: [PATCH] json-exporter, make liveness and readiness probes fully configurable (#4909) This changes makes both probes fully configurable, e.g. you are now able to override timeoutSeconds and other settings. Signed-off-by: Stefan Andres --- charts/prometheus-json-exporter/Chart.yaml | 2 +- .../ci/default-values.yaml | 3 +++ .../templates/deployment.yaml | 14 ++++++-------- charts/prometheus-json-exporter/values.yaml | 9 +++++++++ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/charts/prometheus-json-exporter/Chart.yaml b/charts/prometheus-json-exporter/Chart.yaml index 6b8d41b16ab..1f31e32cebe 100644 --- a/charts/prometheus-json-exporter/Chart.yaml +++ b/charts/prometheus-json-exporter/Chart.yaml @@ -19,7 +19,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.13.0 +version: 0.14.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/prometheus-json-exporter/ci/default-values.yaml b/charts/prometheus-json-exporter/ci/default-values.yaml index 9069ca6da87..70a6114d6b5 100644 --- a/charts/prometheus-json-exporter/ci/default-values.yaml +++ b/charts/prometheus-json-exporter/ci/default-values.yaml @@ -1,2 +1,5 @@ deploymentAnnotations: test-annotation: "true" + +livenessProbe: + timeoutSeconds: 5 diff --git a/charts/prometheus-json-exporter/templates/deployment.yaml b/charts/prometheus-json-exporter/templates/deployment.yaml index e35c719c68d..1b32c047b88 100644 --- a/charts/prometheus-json-exporter/templates/deployment.yaml +++ b/charts/prometheus-json-exporter/templates/deployment.yaml @@ -59,14 +59,12 @@ spec: - name: http containerPort: 7979 protocol: TCP - livenessProbe: - httpGet: - path: /metrics - port: http - readinessProbe: - httpGet: - path: /metrics - port: http + {{- with .Values.livenessProbe }} + livenessProbe: {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: {{- toYaml . | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: diff --git a/charts/prometheus-json-exporter/values.yaml b/charts/prometheus-json-exporter/values.yaml index 5082673685f..e62be5cc84b 100644 --- a/charts/prometheus-json-exporter/values.yaml +++ b/charts/prometheus-json-exporter/values.yaml @@ -42,6 +42,15 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 +livenessProbe: + httpGet: + path: /metrics + port: http +readinessProbe: + httpGet: + path: /metrics + port: http + service: type: ClusterIP port: 7979