Deployments
mysql-deployment.yaml
1
apiVersion: extensions/v1beta1
2
kind: Deployment
3
metadata:
4
name: mysql
5
labels:
6
app: mysql
7
spec:
8
strategy:
9
type: Recreate
10
template:
11
metadata:
12
labels:
13
app: mysql
14
spec:
15
containers:
16
- image: mysql:5.6
17
name: mysql
18
env:
19
- name: MYSQL_DATABASE
20
value: $MYSQL_DATABASE
21
- name: MYSQL_USER
22
value: $MYSQL_USER
23
- name: MYSQL_PASSWORD
24
value: $MYSQL_PASSWORD
25
- name: MYSQL_ROOT_PASSWORD
26
value: $MYSQL_ROOT_PASSWORD
27
ports:
28
- containerPort: 3306
29
name: mysql
30
volumeMounts:
31
- name: mysql-persistent-storage
32
mountPath: /var/lib/mysql
33
volumes:
34
- name: mysql-persistent-storage
35
persistentVolumeClaim:
36
claimName: mysql
37
Copied!
Last modified 3yr ago
Copy link