-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloadbalancer-type-api.yaml
63 lines (63 loc) · 1.26 KB
/
loadbalancer-type-api.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
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: loadbalancer-type-api
annotations:
app: loadbalancer-type-api
spec:
replicas: 2
selector:
matchLabels:
app: loadbalancer-type-api
template:
metadata:
labels:
app: loadbalancer-type-api
spec:
containers:
- name: loadbalancer-type-api
image: gcr.io/moloco-sre/python-ping-api:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
resources:
requests:
cpu: "0.25"
memory: "256Mi"
---
apiVersion: v1
kind: Service
metadata:
name: loadbalancer-type-api
annotations:
app: loadbalancer-type-api
spec:
selector:
app: loadbalancer-type-api
type: LoadBalancer
externalTrafficPolicy: Local
ports:
- port: 80
targetPort: 8000
nodePort: 31000
protocol: TCP
---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: 'loadbalancer-type-api-hpa'
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: 'loadbalancer-type-api'
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50