Skip to content

Commit 5aabfcb

Browse files
authored
Merge pull request #28 from tracebloc/develop
Enhance MySQL deployment configuration in Helm chart
2 parents da38c5a + 190dd81 commit 5aabfcb

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

client/templates/mysql-deployment.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,22 @@ spec:
1919
app: mysql-client
2020
spec:
2121
terminationGracePeriodSeconds: 60
22+
securityContext:
23+
fsGroup: 999
24+
fsGroupChangePolicy: "OnRootMismatch"
2225
initContainers:
26+
- name: init-mysql-data
27+
image: busybox:1.35
28+
securityContext:
29+
runAsUser: 0
30+
command: ['sh', '-c', 'mkdir -p /var/lib/mysql && chown 999:999 /var/lib/mysql && chmod 755 /var/lib/mysql']
31+
volumeMounts:
32+
- name: mysql-persistent-storage
33+
mountPath: /var/lib/mysql/
2334
- name: init-mysql-logs
2435
image: busybox:1.35
36+
securityContext:
37+
runAsUser: 0
2538
command: ['sh', '-c', 'mkdir -p /var/log/mysql && chown -R 999:999 /var/log/mysql && chmod -R 755 /var/log/mysql']
2639
volumeMounts:
2740
- name: mysql-logs
@@ -34,20 +47,26 @@ spec:
3447
memory: 256Mi
3548
cpu: 100m
3649
limits:
37-
memory: 512Mi
38-
cpu: 500m
50+
memory: 1Gi
51+
cpu: 1000m
3952
ports:
4053
- containerPort: 3306
4154
name: mysql-client
55+
startupProbe:
56+
exec:
57+
command: ["mysqladmin", "ping", "-h", "localhost"]
58+
initialDelaySeconds: 10
59+
periodSeconds: 5
60+
failureThreshold: 24
4261
livenessProbe:
4362
exec:
4463
command: ["mysqladmin", "ping", "-h", "localhost"]
45-
initialDelaySeconds: 30
64+
initialDelaySeconds: 0
4665
periodSeconds: 10
4766
readinessProbe:
4867
exec:
4968
command: ["mysqladmin", "ping", "-h", "localhost"]
50-
initialDelaySeconds: 10
69+
initialDelaySeconds: 0
5170
periodSeconds: 5
5271
volumeMounts:
5372
- name: mysql-persistent-storage

client/tests/mysql_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ tests:
4343
value: 256Mi
4444
- equal:
4545
path: spec.template.spec.containers[0].resources.limits.memory
46-
value: 512Mi
46+
value: 1Gi
4747

4848
- it: should create ConfigMap with MySQL config
4949
template: templates/mysql-configmap.yaml

0 commit comments

Comments
 (0)