Skip to content

Commit 3916802

Browse files
committed
Add readiness and liveness probes to MySQL and TodoList deployments; create MySQL Minikube test configuration
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
1 parent 9feb185 commit 3916802

File tree

3 files changed

+127
-7
lines changed

3 files changed

+127
-7
lines changed

tests/e2e/sample-applications/mysql-persistent/mysql-persistent-csi.yaml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,40 @@ items:
104104
volumeMounts:
105105
- name: mysql-data
106106
mountPath: /var/lib/mysql
107+
readinessProbe:
108+
exec:
109+
command:
110+
- /usr/bin/timeout
111+
- 1s
112+
- /usr/bin/mysql
113+
- $(MYSQL_DATABASE)
114+
- -h
115+
- 127.0.0.1
116+
- -u$(MYSQL_USER)
117+
- -p$(MYSQL_PASSWORD)
118+
- -e
119+
- SELECT 1
120+
initialDelaySeconds: 10
121+
periodSeconds: 5
122+
timeoutSeconds: 2
123+
failureThreshold: 3
107124
livenessProbe:
108-
tcpSocket:
109-
port: mysql
125+
exec:
126+
command:
127+
- /usr/bin/timeout
128+
- 1s
129+
- /usr/bin/mysql
130+
- $(MYSQL_DATABASE)
131+
- -h
132+
- 127.0.0.1
133+
- -u$(MYSQL_USER)
134+
- -p$(MYSQL_PASSWORD)
135+
- -e
136+
- SELECT 1
110137
initialDelaySeconds: 30
111138
periodSeconds: 10
112139
timeoutSeconds: 5
140+
failureThreshold: 3
113141
startupProbe:
114142
exec:
115143
command:
@@ -183,6 +211,18 @@ items:
183211
ports:
184212
- containerPort: 8000
185213
protocol: TCP
214+
livenessProbe:
215+
httpGet:
216+
path: /
217+
port: 8000
218+
initialDelaySeconds: 30
219+
periodSeconds: 10
220+
readinessProbe:
221+
httpGet:
222+
path: /
223+
port: 8000
224+
initialDelaySeconds: 10
225+
periodSeconds: 5
186226
initContainers:
187227
- name: init-myservice
188228
image: docker.io/curlimages/curl:8.5.0

tests/e2e/sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,40 @@ items:
9696
volumeMounts:
9797
- name: mysql-data
9898
mountPath: /var/lib/mysql
99+
readinessProbe:
100+
exec:
101+
command:
102+
- /usr/bin/timeout
103+
- 1s
104+
- /usr/bin/mysql
105+
- $(MYSQL_DATABASE)
106+
- -h
107+
- 127.0.0.1
108+
- -u$(MYSQL_USER)
109+
- -p$(MYSQL_PASSWORD)
110+
- -e
111+
- SELECT 1
112+
initialDelaySeconds: 10
113+
periodSeconds: 5
114+
timeoutSeconds: 2
115+
failureThreshold: 3
99116
livenessProbe:
100-
tcpSocket:
101-
port: mysql
117+
exec:
118+
command:
119+
- /usr/bin/timeout
120+
- 1s
121+
- /usr/bin/mysql
122+
- $(MYSQL_DATABASE)
123+
- -h
124+
- 127.0.0.1
125+
- -u$(MYSQL_USER)
126+
- -p$(MYSQL_PASSWORD)
127+
- -e
128+
- SELECT 1
102129
initialDelaySeconds: 30
103130
periodSeconds: 10
104131
timeoutSeconds: 5
132+
failureThreshold: 3
105133
startupProbe:
106134
exec:
107135
command:
@@ -174,6 +202,18 @@ items:
174202
ports:
175203
- containerPort: 8000
176204
protocol: TCP
205+
livenessProbe:
206+
httpGet:
207+
path: /
208+
port: 8000
209+
initialDelaySeconds: 30
210+
periodSeconds: 10
211+
readinessProbe:
212+
httpGet:
213+
path: /
214+
port: 8000
215+
initialDelaySeconds: 10
216+
periodSeconds: 5
177217
volumeMounts:
178218
- name: applog
179219
mountPath: /tmp/log/todoapp/

tests/e2e/sample-applications/mysql-persistent/mysql-persistent.yaml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,40 @@ items:
117117
volumeMounts:
118118
- name: mysql-data
119119
mountPath: /var/lib/mysql
120-
livenessProbe:
121-
tcpSocket:
122-
port: mysql
120+
readinessProbe:
121+
exec:
122+
command:
123+
- /usr/bin/timeout
124+
- 1s
125+
- /usr/bin/mysql
126+
- $(MYSQL_DATABASE)
127+
- -h
128+
- 127.0.0.1
129+
- -u$(MYSQL_USER)
130+
- -p$(MYSQL_PASSWORD)
131+
- -e
132+
- SELECT 1
123133
initialDelaySeconds: 10
134+
periodSeconds: 5
135+
timeoutSeconds: 2
136+
failureThreshold: 3
137+
livenessProbe:
138+
exec:
139+
command:
140+
- /usr/bin/timeout
141+
- 1s
142+
- /usr/bin/mysql
143+
- $(MYSQL_DATABASE)
144+
- -h
145+
- 127.0.0.1
146+
- -u$(MYSQL_USER)
147+
- -p$(MYSQL_PASSWORD)
148+
- -e
149+
- SELECT 1
150+
initialDelaySeconds: 30
124151
periodSeconds: 10
125152
timeoutSeconds: 5
153+
failureThreshold: 3
126154
startupProbe:
127155
exec:
128156
command:
@@ -196,6 +224,18 @@ items:
196224
ports:
197225
- containerPort: 8000
198226
protocol: TCP
227+
livenessProbe:
228+
httpGet:
229+
path: /
230+
port: 8000
231+
initialDelaySeconds: 30
232+
periodSeconds: 10
233+
readinessProbe:
234+
httpGet:
235+
path: /
236+
port: 8000
237+
initialDelaySeconds: 10
238+
periodSeconds: 5
199239
initContainers:
200240
- name: init-myservice
201241
image: docker.io/curlimages/curl:8.5.0

0 commit comments

Comments
 (0)