-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmysql.yaml
69 lines (65 loc) · 1.08 KB
/
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
apiVersion: v1
data:
MYSQL_DATABASE: d29yZHByZXNz
MYSQL_ROOT_PASSWORD: cm9vdHBhc3N3ZA==
kind: Secret
metadata:
creationTimestamp: null
name: mysql-secret
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: mysql-rs
spec:
replicas: 1
selector:
matchLabels:
tier: mysql
template:
metadata:
labels:
tier: mysql
spec:
containers:
- name: mysql
image: mysql
envFrom:
- secretRef:
name: mysql-secret
ports:
- containerPort: 3306
name: mysql
protocol: TCP
volumeMounts:
- name: mysql
mountPath: /var/lib/mysql
volumes:
- name: mysql
persistentVolumeClaim:
claimName: mysql-pvc
---
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
ports:
- port: 3306
protocol: TCP
targetPort: 3306
selector:
tier: mysql
clusterIP: None
---