-
Notifications
You must be signed in to change notification settings - Fork 1
/
mysql-deployment.yaml
39 lines (39 loc) · 970 Bytes
/
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
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
namespace: wordpress
name: mysql-deployment
labels:
app: wordpress
spec:
selector:
matchLabels:
app: wordpress
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: mysql
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass # the one generated before in secret.yml
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage # which data will be stored
mountPath: "/var/lib/mysql"
volumes:
- name: mysql-persistent-storage # PVC
persistentVolumeClaim:
claimName: mysql-persistent-storage