Skip to content

Commit

Permalink
[kube-state-metrics] Allow configuration of startupProbe (#4740)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Kienzler <[email protected]>
Signed-off-by: David Calvert <[email protected]>
Co-authored-by: David Calvert <[email protected]>
  • Loading branch information
SimonKienzler and dotdc authored Jul 26, 2024
1 parent f43a9ac commit e0c1e37
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- prometheus
- kubernetes
type: application
version: 5.22.1
version: 5.23.0
appVersion: 2.13.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
20 changes: 20 additions & 0 deletions charts/kube-state-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,26 @@ spec:
name: "metrics"
{{- end }}
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
httpGet:
{{- if .Values.hostNetwork }}
host: 127.0.0.1
{{- end }}
httpHeaders:
{{- range $_, $header := .Values.startupProbe.httpGet.httpHeaders }}
- name: {{ $header.name }}
value: {{ $header.value }}
{{- end }}
path: /livez
port: {{ $servicePort }}
scheme: {{ upper .Values.startupProbe.httpGet.scheme }}
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
successThreshold: {{ .Values.startupProbe.successThreshold }}
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
{{- end }}
livenessProbe:
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
httpGet:
Expand Down
17 changes: 17 additions & 0 deletions charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,23 @@ initContainers: []
# - name: crd-sidecar
# image: kiwigrid/k8s-sidecar:latest

## Settings for startup, liveness and readiness probes
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
##

## Startup probe can optionally be enabled.
##
startupProbe:
enabled: false
failureThreshold: 3
httpGet:
httpHeaders: []
scheme: http
initialDelaySeconds: 0
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5

## Liveness probe
##
livenessProbe:
Expand Down

0 comments on commit e0c1e37

Please sign in to comment.