-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yml
155 lines (155 loc) · 2.96 KB
/
deployment.yml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
selector:
app: mysql
ports:
- name: mysql
port: 3306
targetPort: 3306
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
replicas: 1
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:8.0
env:
- name: MYSQL_ROOT_PASSWORD
value: root
- name: MYSQL_DATABASE
value: user_login
ports:
- containerPort: 3306
name: mysql
---
apiVersion: v1
kind: Service
metadata:
name: user-app
spec:
selector:
app: user-app
ports:
- name: http
port: 8000
targetPort: 8000
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-app
spec:
selector:
matchLabels:
app: user-app
replicas: 3
template:
metadata:
labels:
app: user-app
spec:
containers:
- name: user-app
image: adesupraptolaia/user_login:latest
env:
- name: DB_HOST
value: mysql
- name: APP_NAME
value: user
- name: AUTH_SERVICE_PRIVATE_URL
value: "auth-app-private.default.svc.cluster.local:9001"
ports:
- containerPort: 8000
name: http
livenessProbe:
httpGet:
path: /
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
name: auth-app
spec:
selector:
app: auth-app
ports:
- name: http-public
port: 9000
targetPort: 9000
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
name: auth-app-private
spec:
selector:
app: auth-app
ports:
- name: http-private
port: 9001
targetPort: 9001
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-app
spec:
selector:
matchLabels:
app: auth-app
replicas: 3
template:
metadata:
labels:
app: auth-app
spec:
containers:
- name: auth-app
image: adesupraptolaia/user_login:latest
env:
- name: DB_HOST
value: mysql
- name: APP_NAME
value: auth
ports:
- containerPort: 9000
name: http-public
- containerPort: 9001
name: http-private
livenessProbe:
httpGet:
path: /
port: 9000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 9000
initialDelaySeconds: 30
periodSeconds: 10