-
Notifications
You must be signed in to change notification settings - Fork 51
/
mysql-deployment.yml
57 lines (57 loc) · 1.07 KB
/
mysql-deployment.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
apiVersion: v1
kind: Service
metadata:
name: mysql
labels:
template: mysql-ephemeral
spec:
ports:
- name: mysql
protocol: TCP
port: 3306
targetPort: 3306
nodePort: 0
selector:
name: mysql
type: ClusterIP
sessionAffinity: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
spec:
strategy:
type: Recreate
selector:
matchLabels:
name: mysql
app: mysql
template:
metadata:
name: mysql
labels:
name: mysql
spec:
containers:
- image: mysql:5.6
name: mysql
ports:
- containerPort: 3306
protocol: TCP
env:
- name : MYSQL_USER
value: ${MYSQL_USER}
- name: MYSQL_PASSWORD
value: ${MYSQL_PASSWORD}
- name: MYSQL_DATABASE
value: ${MYSQL_DATABASE}
- name: MYSQL_RANDOM_ROOT_PASSWORD
value: 'yes'
volumeMounts:
- name: mysql-data
mountPath: /var/lib/mysql/data
volumes:
- name: mysql-data
emptyDir:
medium: