-
Notifications
You must be signed in to change notification settings - Fork 235
/
Copy pathtis-test-mysql.yaml
72 lines (71 loc) · 1.35 KB
/
tis-test-mysql.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
61
62
63
64
65
66
67
68
69
70
71
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-cnf
data:
my.cnf: |
[mysqld]
expire_logs_days=10
default-time_zone='+8:00'
log-bin=mysql-bin
server-id=1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
serviceName: mysql-svc
template:
metadata:
name: mysql
labels:
app: mysql
spec:
volumes:
- name: my-cnf-volume
configMap:
name: my-cnf
containers:
- env:
- name: MYSQL_ROOT_PASSWORD
value: "123456"
- name: TZ
value: "Asia/Shanghai"
image: registry.cn-hangzhou.aliyuncs.com/tis/mysql:5.7
imagePullPolicy: IfNotPresent
name: mysql
volumeMounts:
- name: my-cnf-volume
mountPath: "/etc/mysql/my.cnf"
subPath: my.cnf
readOnly: true
ports:
- containerPort: 3306
name: mysql-3306
protocol: TCP
resources:
requests:
cpu: "2"
memory: 4Gi
terminationGracePeriodSeconds: 3
---
apiVersion: v1
kind: Service
metadata:
name: mysql-svc
spec:
ports:
- name: mysql-svc
nodePort: 32005
port: 3306
protocol: TCP
targetPort: 3306
selector:
app: mysql
type: LoadBalancer