Skip to content

Commit 10f08ce

Browse files
authored
Merge pull request #318 from acekingke/livenessMysql
sysbench press the database, Pod is recreated by k8s #305
2 parents e631933 + 7a24589 commit 10f08ce

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

mysqlcluster/container/mysql.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,7 @@ func (c *mysql) getLivenessProbe() *corev1.Probe {
8888
return &corev1.Probe{
8989
Handler: corev1.Handler{
9090
Exec: &corev1.ExecAction{
91-
Command: []string{
92-
"sh",
93-
"-c",
94-
fmt.Sprintf("mysqladmin --defaults-file=%s ping", utils.ConfClientPath),
95-
},
91+
Command: []string{"pgrep", "mysqld"},
9692
},
9793
},
9894
InitialDelaySeconds: 30,

mysqlcluster/container/mysql_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestGetMysqlLivenessProbe(t *testing.T) {
107107
livenessProbe := &corev1.Probe{
108108
Handler: corev1.Handler{
109109
Exec: &corev1.ExecAction{
110-
Command: []string{"sh", "-c", "mysqladmin --defaults-file=/etc/mysql/client.conf ping"},
110+
Command: []string{"pgrep", "mysqld"},
111111
},
112112
},
113113
InitialDelaySeconds: 30,

0 commit comments

Comments
 (0)