forked from atulabhi/mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mysql-deployment.yaml
60 lines (60 loc) · 1.2 KB
/
mysql-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
serviceName: mysql
replicas: 1
template:
metadata:
labels:
app: mysql
spec:
securityContext:
fsGroup: 106
initContainers:
- name: volume-mount-hack
image: busybox
command: ["sh", "-c", "rm -rf /var/lib/mysql/lost+found"]
volumeMounts:
- name: maya-database
mountPath: /var/lib/mysql
containers:
- name: mysql
image: mysql:5.7
env:
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "1"
ports:
- name: mysql
containerPort: 3306
volumeMounts:
- name: maya-database
mountPath: /var/lib/mysql
volumeClaimTemplates:
- metadata:
name: maya-database
spec:
storageClassName: standard
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 200Gi
---
# Headless service for stable DNS entries of StatefulSet members.
apiVersion: v1
kind: Service
metadata:
name: mysql
labels:
app: mysql
spec:
ports:
- name: mysql
port: 3306
clusterIP: None
selector:
app: mysql