-
Notifications
You must be signed in to change notification settings - Fork 466
Expand file tree
/
Copy pathdeployment.yaml
More file actions
91 lines (85 loc) · 1.68 KB
/
Copy pathdeployment.yaml
File metadata and controls
91 lines (85 loc) · 1.68 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
# Deployment do banco de dados
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgre
spec:
selector:
matchLabels:
app: postgre
template:
metadata:
labels:
app: postgre
spec:
containers:
- name: postgre
image: postgres:13.16
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
value: fakeshop
- name: POSTGRES_USER
value: fakeshop
- name: POSTGRES_PASSWORD
value: Pg1234
---
apiVersion: v1
kind: Service
metadata:
name: postgre
spec:
selector:
app: postgre
ports:
- port: 5432
targetPort: 5432
---
# Deployment da aplicação web
apiVersion: apps/v1
kind: Deployment
metadata:
name: fakeshop
spec:
replicas: 4
selector:
matchLabels:
app: fakeshop
template:
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '500'
prometheus.io/path: '/metrics'
labels:
app: fakeshop
spec:
containers:
- name: fakeshop
image: fjschicosilva/fake-shop:v2
ports:
- containerPort: 5000
env:
- name: DB_HOST
value: postgre
- name: DB_USER
value: fakeshop
- name: DB_PASSWORD
value: Pg1234
- name: DB_NAME
value: fakeshop
- name: FLASK_APP
value: index.py
---
apiVersion: v1
kind: Service
metadata:
name: fakeshop
spec:
selector:
app: fakeshop
ports:
- port: 80
targetPort: 5000
type: LoadBalancer