forked from hail-is/hail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
116 lines (116 loc) · 2.81 KB
/
deployment.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
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway-deployment
labels:
app: gateway
hail.is/sha: "{{ code.sha }}"
spec:
selector:
matchLabels:
app: gateway
replicas: 3
template:
metadata:
labels:
app: gateway
hail.is/sha: "{{ code.sha }}"
envoy: "true"
spec:
priorityClassName: infrastructure
nodeSelector:
preemptible: "true"
tolerations:
- key: preemptible
value: "true"
- key: "kubernetes.azure.com/scalesetpriority"
value: "spot"
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- gateway
topologyKey: "kubernetes.io/hostname"
containers:
- name: gateway
image: "{{ global.docker_prefix }}/envoyproxy/envoy:v1.22.3"
command:
- /usr/local/bin/envoy
- --config-path
- /etc/envoy/envoy.yaml
- --concurrency
- "2"
- --service-cluster
- gateway
- --service-node
- $(hostname)
resources:
requests:
cpu: "20m"
memory: "20M"
limits:
cpu: "1"
memory: "1G"
ports:
- containerPort: 8080
- containerPort: 8443
- containerPort: 8001
volumeMounts:
- mountPath: /etc/letsencrypt
name: letsencrypt-config
- name: ssl-config-gateway
mountPath: /ssl-config
readOnly: true
- name: gateway-envoy-config
mountPath: /etc/envoy
readOnly: true
- name: gateway-xds-config
mountPath: /config_map/xds
readOnly: true
volumes:
- name: letsencrypt-config
secret:
secretName: letsencrypt-config
- name: ssl-config-gateway
secret:
optional: false
secretName: ssl-config-gateway
- name: gateway-envoy-config
configMap:
name: gateway-envoy-config
- name: gateway-xds-config
configMap:
name: gateway-xds-config
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: gateway
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: gateway
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 2500
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: gateway
spec:
minAvailable: 2
selector:
matchLabels:
app: gateway