Skip to content

Commit 84eef38

Browse files
authored
feat: helm add templates for health and readiness probes (#1864)
* template liveness and readinses probes * add more detailed templating
1 parent b7ca150 commit 84eef38

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

helm/templates/deployment.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,32 @@ spec:
4444
- name: http
4545
containerPort: {{ .Values.service.targetPort }}
4646
protocol: TCP
47+
{{- if .Values.deployment.livenessProbe.enabled }}
4748
livenessProbe:
48-
timeoutSeconds: 10
49+
timeoutSeconds: {{ .Values.deployment.livenessProbe.timeoutSeconds | default 10 }}
50+
{{- with .Values.deployment.livenessProbe.httpGet }}
51+
httpGet:
52+
path: {{ .path | default "/" }}
53+
port: {{ .port | default "http" }}
54+
{{- else }}
4955
httpGet:
5056
path: /
5157
port: http
58+
{{- end }}
59+
{{- end }}
60+
{{- if .Values.deployment.readinessProbe.enabled }}
5261
readinessProbe:
53-
timeoutSeconds: 10
62+
timeoutSeconds: {{ .Values.deployment.readinessProbe.timeoutSeconds | default 10 }}
63+
{{- with .Values.deployment.readinessProbe.httpGet }}
64+
httpGet:
65+
path: {{ .path | default "/" }}
66+
port: {{ .port | default "http" }}
67+
{{- else }}
5468
httpGet:
5569
path: /
5670
port: http
71+
{{- end }}
72+
{{- end }}
5773
resources:
5874
{{- toYaml .Values.resources | nindent 12 }}
5975
{{- with .Values.nodeSelector }}

helm/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ service:
4343
type: ClusterIP
4444
port: 80
4545

46+
deployment:
47+
livenessProbe:
48+
enabled: true
49+
readinessProbe:
50+
enabled: true
51+
4652
ingress:
4753
enabled: false
4854
className: ""

0 commit comments

Comments
 (0)