-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmysql.yml
76 lines (72 loc) · 1.46 KB
/
mysql.yml
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
72
73
74
75
76
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc2
annotations:
volume.beta.kubernetes.io/storage-class: "efs-sc"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: mysqlrs4
spec:
replicas: 1
selector:
matchExpressions:
- {key: env,operator: In,values: [dev]}
template:
metadata:
name: mysqlpod2
labels:
env: dev
spec:
containers:
- name: "mysql"
image: "mysql:5.6"
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlsecret
key: rootpassword
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysqlsecret
key: dbname
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysqlsecret
key: user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlsecret
key: password
volumeMounts:
- mountPath: /var/lib/mysql
name: task-pv-storage1
volumes:
- name: task-pv-storage1
persistentVolumeClaim:
claimName: pvc2
---
apiVersion: v1
kind: Service
metadata:
name: sqllb
spec:
clusterIP: None
selector:
env: dev
type: "ClusterIP"
ports:
- port: 8500
targetPort: 3306