Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions client/templates/mysql-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,30 @@ spec:
# routinely needs >1s to even spawn, which kubelet reports as a probe
# failure and kills the container. 5s is generous enough to survive
# transient CPU pressure but still catch a real hang within ~25s.
#
# Probe over TCP (-h 127.0.0.1), NOT the unix socket (-h localhost):
# the mysql-client image writes its socket to /var/lib/mysql/mysql.sock,
# not the client default /var/run/mysqld/mysqld.sock, so a socket-based
# `mysqladmin ping` can't reach a perfectly healthy mysqld — the startup
# probe then exhausts and the kubelet kill-loops the DB. TCP is immune to
# where the image places the socket. Do not change back to `localhost`.
startupProbe:
exec:
command: ["mysqladmin", "ping", "-h", "localhost"]
command: ["mysqladmin", "ping", "-h", "127.0.0.1"]
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 24
livenessProbe:
exec:
command: ["mysqladmin", "ping", "-h", "localhost"]
command: ["mysqladmin", "ping", "-h", "127.0.0.1"]
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
readinessProbe:
exec:
command: ["mysqladmin", "ping", "-h", "localhost"]
command: ["mysqladmin", "ping", "-h", "127.0.0.1"]
initialDelaySeconds: 0
periodSeconds: 5
timeoutSeconds: 3
Expand Down
38 changes: 38 additions & 0 deletions client/tests/mysql_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,41 @@ tests:
- equal:
path: spec.selector.app
value: mysql-client

# --- Regression guards (backend#767): the kill-loop was a healthy mysqld
# killed by a probe pointed at the wrong socket. Lock the probe to TCP so a
# future edit (or an image socket-path change) can't reintroduce it. ---
- it: all three probes must use TCP (127.0.0.1), never the unix socket (-h localhost)
template: templates/mysql-deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].startupProbe.exec.command
content: "127.0.0.1"
- contains:
path: spec.template.spec.containers[0].livenessProbe.exec.command
content: "127.0.0.1"
- contains:
path: spec.template.spec.containers[0].readinessProbe.exec.command
content: "127.0.0.1"
- notContains:
path: spec.template.spec.containers[0].startupProbe.exec.command
content: "localhost"
- notContains:
path: spec.template.spec.containers[0].livenessProbe.exec.command
content: "localhost"
- notContains:
path: spec.template.spec.containers[0].readinessProbe.exec.command
content: "localhost"
- it: mysqld keeps its writable scratch mounts under readOnlyRootFilesystem (socket/pid dir + tmp)
template: templates/mysql-deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: mysql-run
mountPath: /var/run/mysqld
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: mysql-tmp
mountPath: /tmp
Loading