-
Notifications
You must be signed in to change notification settings - Fork 6
/
kubernetes.yml
130 lines (130 loc) · 2.57 KB
/
kubernetes.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
apiVersion: v1
kind: Namespace
metadata:
name: veri
---
apiVersion: v1
kind: Service
metadata:
name: veriservice
namespace: veri
spec:
selector:
app: veri
ports:
- port: 10000
targetPort: 10000
---
apiVersion: v1
kind: Service
metadata:
name: veriservice-external
namespace: veri
spec:
selector:
app: veri
ports:
- port: 5678
targetPort: 10000
name: "grpc"
- port: 6060
targetPort: 6060
name: "pprof"
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: veri
name: veri
namespace: veri
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 5%
maxSurge: 1
selector:
matchLabels:
app: veri
template:
metadata:
labels:
app: veri
spec:
containers:
- name: veri
image: berkgokden/veri:v0.0.104
args: ["serve", "--services=veriservice:10000"]
imagePullPolicy: IfNotPresent
ports:
- containerPort: 10000
name: "grpc"
protocol: TCP
- containerPort: 8000
name: "http"
protocol: TCP
- containerPort: 6060
name: "pprof"
protocol: TCP
livenessProbe:
httpGet:
path: /health
port: http
failureThreshold: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: http
failureThreshold: 3
periodSeconds: 10
startupProbe:
httpGet:
path: /ready
port: http
failureThreshold: 30
periodSeconds: 10
env:
- name: BROADCAST
valueFrom:
fieldRef:
fieldPath: status.podIP
resources:
requests:
memory: "128Mi"
cpu: "512m"
limits:
memory: "512Mi"
cpu: "1000m"
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: veri
namespace: veri
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: veri
minReplicas: 3
maxReplicas: 15
behavior:
scaleDown:
stabilizationWindowSeconds: 900 # 15 minutes in seconds
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 20
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 20