-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmysq.yaml
60 lines (60 loc) · 1.09 KB
/
mysq.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
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mysql-config
labels:
app: mysql
data:
MYSQL_ROOT_PASSWORD: "CloudAcademy!"
MYSQL_PASSWORD: "CloudAcademy!"
MYSQL_USER: "api_user"
MYSQL_DATABASE: "orders"
---
apiVersion: v1
kind: Service
metadata:
name: mysql
labels:
app: mysql
spec:
ports:
- port: 3306
name: mysql
clusterIP: None
selector:
app: mysql
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
serviceName: "mysql"
replicas: 1
template:
metadata:
labels:
app: mysql
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mysql
image: public.ecr.aws/cloudacademy-labs/cloudacademy/labs/k8s-assessment/mysql:8
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql
mountPath: /var/lib/mysql
envFrom:
- configMapRef:
name: mysql-config
volumes:
- name: mysql
hostPath:
path: /tmp/mysql/
type: Directory