forked from douglascase/JenkinsDocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s_mysql.yaml
55 lines (55 loc) · 1.05 KB
/
k8s_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
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: permissao-banco-dados
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 3Gi
---
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
type: LoadBalancer
ports:
- port: 3306
name: tcp
nodePort: 32600
selector:
name: mysql-pod
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: statefulset-mysql
spec:
serviceName: mysql
selector:
matchLabels:
name: mysql-pod
template:
metadata:
labels:
name: mysql-pod
spec:
containers:
- name: container-mysql
image: mysql:5.7
ports:
- containerPort: 3306
env:
- name: MYSQL_DATABASE
value: "optimusweb"
- name: MYSQL_ROOT_PASSWORD
value: "12345"
volumeMounts:
- name: banco-dados
mountPath: /var/lib/mysql
volumes:
- name: banco-dados
persistentVolumeClaim:
claimName: permissao-banco-dados