Skip to content

Commit 0107ba6

Browse files
committed
feat(hpa-real.yml): Add real example of HPA (autoscaling)
1 parent b737120 commit 0107ba6

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

hpa-real.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: hpav1-web
5+
spec:
6+
selector:
7+
matchLabels:
8+
app: hpav1-web
9+
replicas: 10
10+
template:
11+
metadata:
12+
labels:
13+
app: hpav1-web
14+
spec:
15+
containers:
16+
- name: app
17+
image: ondrejsika/go-hello-world:2
18+
ports:
19+
- containerPort: 80
20+
resources:
21+
requests:
22+
cpu: 40m
23+
memory: 30Mi
24+
limits:
25+
cpu: 80m
26+
memory: 50Mi
27+
---
28+
apiVersion: v1
29+
kind: Service
30+
metadata:
31+
name: hpa-service
32+
spec:
33+
type: NodePort
34+
ports:
35+
- port: 80
36+
targetPort: 80
37+
selector:
38+
app: hpav1-web
39+
---
40+
apiVersion: autoscaling/v1
41+
kind: HorizontalPodAutoscaler
42+
metadata:
43+
name: hpav1
44+
spec:
45+
maxReplicas: 30
46+
minReplicas: 10
47+
scaleTargetRef:
48+
apiVersion: apps/v1
49+
kind: Deployment
50+
name: hpav1-web
51+
targetCPUUtilizationPercentage: 90

0 commit comments

Comments
 (0)