Skip to content

Commit

Permalink
[kube-prometheus-stack]: Add probes for prometheus-operator (#4777)
Browse files Browse the repository at this point in the history
Co-authored-by: François Blondel <[email protected]>
  • Loading branch information
Farfaday and François Blondel authored Aug 8, 2024
1 parent 19af482 commit bada876
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 61.7.1
version: 61.7.2
appVersion: v0.75.2
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,30 @@ spec:
{{- with .Values.prometheusOperator.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.prometheusOperator.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /healthz
port: {{ .Values.prometheusOperator.tls.enabled | ternary "https" "http" }}
scheme: {{ .Values.prometheusOperator.tls.enabled | ternary "HTTPS" "HTTP" }}
initialDelaySeconds: {{ .Values.prometheusOperator.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.prometheusOperator.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.prometheusOperator.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.prometheusOperator.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.prometheusOperator.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.prometheusOperator.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /healthz
port: {{ .Values.prometheusOperator.tls.enabled | ternary "https" "http" }}
scheme: {{ .Values.prometheusOperator.tls.enabled | ternary "HTTPS" "HTTP" }}
initialDelaySeconds: {{ .Values.prometheusOperator.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.prometheusOperator.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.prometheusOperator.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.prometheusOperator.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.prometheusOperator.livenessProbe.failureThreshold }}
{{- end }}
volumes:
{{- if .Values.prometheusOperator.tls.enabled }}
- name: tls-secret
Expand Down
19 changes: 19 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,25 @@ prometheusOperator:
# The default webhook port is 10250 in order to work out-of-the-box in GKE private clusters and avoid adding firewall rules.
internalPort: 10250

## Liveness probe for the prometheusOperator deployment
##
livenessProbe:
enabled: true
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
## Readiness probe for the prometheusOperator deployment
##
readinessProbe:
enabled: true
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1

## Admission webhook support for PrometheusRules resources added in Prometheus Operator 0.30 can be enabled to prevent incorrectly formatted
## rules from making their way into prometheus and potentially preventing the container from starting
admissionWebhooks:
Expand Down

0 comments on commit bada876

Please sign in to comment.