-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkubernetes.yaml
More file actions
107 lines (105 loc) · 2.29 KB
/
kubernetes.yaml
File metadata and controls
107 lines (105 loc) · 2.29 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# MySQL Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: provocation-mysql
labels:
app: provocation-mysql
spec:
replicas: 1
selector:
matchLabels:
app: provocation-mysql
template:
metadata:
labels:
app: provocation-mysql
spec:
containers:
- name: mysql
image: mysql:8.0.33
ports:
- containerPort: 3306
env:
- name: MYSQL_DATABASE
valueFrom:
configMapKeyRef:
name: app-config
key: MYSQL_DATABASE
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: app-secret
key: MYSQL_ROOT_PASSWORD
- name: TZ
valueFrom:
configMapKeyRef:
name: app-config
key: TZ
args:
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_unicode_ci"
volumeMounts:
- name: mysql-data
mountPath: /var/lib/mysql
volumes:
- name: mysql-data
hostPath:
path: /mnt/data/mysql
type: DirectoryOrCreate
---
# MySQL Service
apiVersion: v1
kind: Service
metadata:
name: provocation-mysql
spec:
selector:
app: provocation-mysql
ports:
- protocol: TCP
port: 3306
targetPort: 3306
---
# Spring Boot Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: provocation-springboot
labels:
app: provocation-springboot
spec:
replicas: 1
selector:
matchLabels:
app: provocation-springboot
template:
metadata:
labels:
app: provocation-springboot
spec:
containers:
- name: springboot-app
image: checkmatekgu/provocation-springboot-container:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: app-config
- secretRef:
name: app-secret
---
# Spring Boot Service
apiVersion: v1
kind: Service
metadata:
name: provocation-springboot
spec:
selector:
app: provocation-springboot
ports:
- protocol: TCP
port: 8080
targetPort: 8080
type: LoadBalancer