-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
106 lines (106 loc) · 2.72 KB
/
deployment.yaml
File metadata and controls
106 lines (106 loc) · 2.72 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
106
apiVersion: apps/v1
kind: Deployment
metadata:
name: grpc-gateway
spec:
replicas: 1
selector:
matchLabels:
app: grpc-gateway
template:
metadata:
labels:
app: grpc-gateway
spec:
containers:
- name: grpc-gateway
image: gcr.io/threadit-api/grpc-gateway:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
requests:
cpu: 40m
memory: 80Mi
limits:
cpu: 120m
memory: 240Mi
env:
- name: GRPC_GATEWAY_PORT
valueFrom:
configMapKeyRef:
name: threadit-config
key: GRPC_GATEWAY_PORT
- name: COMMUNITY_SERVICE_HOST
value: "community-service"
- name: COMMUNITY_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: threadit-config
key: COMMUNITY_SERVICE_PORT
- name: THREAD_SERVICE_HOST
value: "thread-service"
- name: THREAD_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: threadit-config
key: THREAD_SERVICE_PORT
- name: COMMENT_SERVICE_HOST
value: "comment-service"
- name: COMMENT_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: threadit-config
key: COMMENT_SERVICE_PORT
- name: VOTE_SERVICE_HOST
value: "vote-service"
- name: VOTE_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: threadit-config
key: VOTE_SERVICE_PORT
- name: SEARCH_SERVICE_HOST
value: "search-service"
- name: SEARCH_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: threadit-config
key: SEARCH_SERVICE_PORT
- name: POPULAR_SERVICE_HOST
value: "popular-service"
- name: POPULAR_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: threadit-config
key: POPULAR_SERVICE_PORT
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 5
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: grpc-gateway-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: grpc-gateway
minReplicas: 1
maxReplicas: 4
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80