Skip to content

Commit

Permalink
Add startupProbe for deployment and use a flag to enable/disable it
Browse files Browse the repository at this point in the history
  • Loading branch information
mstiri committed Apr 18, 2023
1 parent 58726f0 commit 8c258bb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions charts/podinfo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ spec:
containerPort: {{ .Values.service.grpcPort }}
protocol: TCP
{{- end }}
{{- if .Values.probes.startup.enable }}
startupProbe:
exec:
command:
- podcli
- check
- http
- localhost:{{ .Values.service.httpPort | default 9898 }}/healthz
{{- with .Values.probes.startup }}
initialDelaySeconds: {{ .initialDelaySeconds | default 1 }}
timeoutSeconds: {{ .timeoutSeconds | default 5 }}
failureThreshold: {{ .failureThreshold | default 3 }}
successThreshold: {{ .successThreshold | default 1 }}
periodSeconds: {{ .periodSeconds | default 10 }}
{{- end }}
{{- end }}
livenessProbe:
exec:
command:
Expand Down
7 changes: 7 additions & 0 deletions charts/podinfo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,10 @@ probes:
failureThreshold: 3
successThreshold: 1
periodSeconds: 10
startup:
enable: false
initialDelaySeconds: 10
timeoutSeconds: 5
failureThreshold: 20
successThreshold: 1
periodSeconds: 10

0 comments on commit 8c258bb

Please sign in to comment.