-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathds.yml
More file actions
81 lines (80 loc) · 1.46 KB
/
ds.yml
File metadata and controls
81 lines (80 loc) · 1.46 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
---
# MySQL Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: mysql
spec:
containers:
- image: mysql:8
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "Test@123"
- name: MYSQL_DATABASE
value: "bankappdb"
ports:
- containerPort: 3306
name: mysql
---
# MySQL Service
apiVersion: v1
kind: Service
metadata:
name: mysql-service
spec:
ports:
- port: 3306
selector:
app: mysql
---
# Java Application Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: bankapp
spec:
replicas: 1
selector:
matchLabels:
app: bankapp
template:
metadata:
labels:
app: bankapp
spec:
containers:
- name: bankapp
image: adijaiswal/bankapp:latest
ports:
- containerPort: 8080
env:
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://mysql-service:3306/bankappdb?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
- name: SPRING_DATASOURCE_USERNAME
value: root
- name: SPRING_DATASOURCE_PASSWORD
value: Test@123
---
# Bank Application Service
apiVersion: v1
kind: Service
metadata:
name: bankapp-service
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
selector:
app: bankapp