-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathkubernetes.yaml
77 lines (74 loc) · 1.58 KB
/
kubernetes.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
apiVersion : apps/v1
kind: Deployment
metadata:
name: verapdf-rest-deployment
labels:
instance: veraPDF-rest
part-of : veraPDF
spec:
selector:
matchLabels:
project: verapdf-rest
template:
metadata:
labels:
project: verapdf-rest
spec:
terminationGracePeriodSeconds: 300
containers:
- name : verapdf-rest
image: ghcr.io/verapdf/rest:dev
lifecycle:
preStop:
exec:
command: ["/bin/sleep", "300"]
resources:
requests:
cpu: "250m"
limits:
cpu: "2000m"
ports:
- containerPort: 8080
name : rest-api-port
- containerPort: 8081
name : diagnostic-port
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: verapdf-rest-autoscaling
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: verapdf-rest-deployment
minReplicas: 2
maxReplicas: 4
metrics:
- type: Resource
resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
---
apiVersion: v1
kind: Service
metadata:
name: verapdf-rest-service
labels:
instance: veraPDF-rest
part-of : veraPDF
spec:
selector:
project: verapdf-rest
ports:
- name : rest-api-listener
protocol : TCP
port : 8080
targetPort: 8080
- name : diagnostic-listener
protocol : TCP
port : 8081
targetPort: 8081
type: LoadBalancer