-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s-manifest.yaml
112 lines (107 loc) · 2.31 KB
/
k8s-manifest.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
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
106
107
108
109
110
111
112
apiVersion: apps/v1
kind: Deployment
metadata:
name: avito-tender-app
labels:
app: avito-tender
spec:
replicas: 1
selector:
matchLabels:
app: avito-tender
template:
metadata:
labels:
app: avito-tender
spec:
containers:
- name: avito-tender
image: mikhailpmikhail/avitotender-app:latest
ports:
- containerPort: 8080
env:
- name: SERVER_ADDRESS
value: "0.0.0.0:8080"
- name: POSTGRES_USERNAME
value: "postgres"
- name: POSTGRES_PASSWORD
value: "workout+5"
- name: POSTGRES_HOST
value: "db"
- name: POSTGRES_PORT
value: "5432"
- name: POSTGRES_DATABASE
value: "AvitoTender"
- name: POSTGRES_CONN
value: "postgres://postgres:workout+5@db:5432/AvitoTender?sslmode=disable"
- name: POSTGRES_JDBC_URL
value: "jdbc:postgresql://db:5432/AvitoTender"
---
apiVersion: v1
kind: Service
metadata:
name: avito-tender-service
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
app: avito-tender
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: avito-tender-db
spec:
replicas: 1
selector:
matchLabels:
app: avito-tender-db
template:
metadata:
labels:
app: avito-tender-db
spec:
containers:
- name: postgres
image: postgres:16
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
value: "AvitoTender"
- name: POSTGRES_USER
value: "postgres"
- name: POSTGRES_PASSWORD
value: "workout+5"
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: db-storage
volumes:
- name: db-storage
persistentVolumeClaim:
claimName: avito-tender-db-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: avito-tender-db-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: avito-tender-db-service
spec:
type: ClusterIP
ports:
- port: 5432
targetPort: 5432
selector:
app: avito-tender-db