Skip to content

Commit c7bf213

Browse files
committed
Add customizable probes for MySQL containers
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
1 parent f98c0b2 commit c7bf213

2 files changed

Lines changed: 36 additions & 14 deletions

File tree

charts/devlake/templates/statefulsets.yaml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,18 @@ spec:
6969
- name: mysql
7070
containerPort: 3306
7171
protocol: TCP
72+
{{- with .Values.mysql.startupProbe }}
73+
startupProbe:
74+
{{- toYaml . | nindent 12 }}
75+
{{- end }}
76+
{{- with .Values.mysql.livenessProbe }}
7277
livenessProbe:
73-
exec:
74-
command:
75-
- "sh"
76-
- "-c"
77-
- "mysqladmin ping -u root -p$MYSQL_ROOT_PASSWORD"
78-
initialDelaySeconds: 60
79-
timeoutSeconds: 30
78+
{{- toYaml . | nindent 12 }}
79+
{{- end }}
80+
{{- with .Values.mysql.readinessProbe }}
8081
readinessProbe:
81-
exec:
82-
command:
83-
- "sh"
84-
- "-c"
85-
- "mysqladmin ping -u root -p$MYSQL_ROOT_PASSWORD"
86-
initialDelaySeconds: 5
87-
timeoutSeconds: 10
82+
{{- toYaml . | nindent 12 }}
83+
{{- end }}
8884
{{- with .Values.mysql.resources }}
8985
resources:
9086
{{- toYaml . | nindent 12 }}

charts/devlake/values.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,32 @@ mysql:
9595

9696
podAnnotations: {}
9797

98+
# Probes for MySQL container
99+
startupProbe:
100+
exec: &mysql_ping_exec
101+
command:
102+
- "sh"
103+
- "-c"
104+
- "mysqladmin ping -u root -p$MYSQL_ROOT_PASSWORD"
105+
initialDelaySeconds: 120
106+
periodSeconds: 10
107+
timeoutSeconds: 10
108+
failureThreshold: 60
109+
110+
livenessProbe:
111+
exec: *mysql_ping_exec
112+
initialDelaySeconds: 60
113+
periodSeconds: 10
114+
timeoutSeconds: 30
115+
failureThreshold: 5
116+
117+
readinessProbe:
118+
exec: *mysql_ping_exec
119+
initialDelaySeconds: 5
120+
periodSeconds: 5
121+
timeoutSeconds: 10
122+
failureThreshold: 3
123+
98124
service:
99125
type: "ClusterIP"
100126
nodePort: ""

0 commit comments

Comments
 (0)