forked from ouqiang/gocron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mysql-st.yaml
53 lines (53 loc) · 1006 Bytes
/
mysql-st.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
---
apiVersion: v1
kind: Service
metadata:
name: mysql
#namespace: storage
labels:
app: mysql
spec:
ports:
- port: 3306
name: mysql
clusterIP: None
selector:
app: mysql
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: mysql
#namespace: storage
spec:
serviceName: "mysql"
replicas: 1
template:
metadata:
labels:
app: mysql
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mysql
image: mysql:5.6
env:
- name: MYSQL_ROOT_PASSWORD
value: password
- name: MYSQL_DATABASE
value: crontab
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-vol
mountPath: /var/lib/mysql
volumeClaimTemplates:
- metadata:
name: mysql-vol
spec:
storageClassName: rbd # 需要storageClassName
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 100Gi