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