Skip to content

Commit 00d7383

Browse files
authored
Create hapnew.yml
1 parent 1b657fe commit 00d7383

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Kubernetese/hpa/hapnew.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: nginx
6+
labels:
7+
app: nginx
8+
spec:
9+
replicas: 3
10+
selector:
11+
matchLabels:
12+
app: nginx
13+
template:
14+
metadata:
15+
name: nginxpod
16+
labels:
17+
app: nginx
18+
spec:
19+
containers:
20+
- name: nginx
21+
image: nginx:latest
22+
resources:
23+
limits:
24+
cpu: 20m ## 10% of 1 core on your system
25+
26+
---
27+
28+
apiVersion: v1
29+
kind: Service
30+
metadata:
31+
name: nginx-svc
32+
spec:
33+
type: ClusterIP ## this is default if we do not type in service definition
34+
selector:
35+
app: nginx
36+
ports:
37+
- protocol: TCP
38+
port: 80
39+
targetPort: 80
40+
41+
---
42+
43+
apiVersion: autoscaling/v1
44+
kind: HorizontalPodAutoscaler
45+
metadata:
46+
name: nginx-hpa
47+
spec:
48+
scaleTargetRef:
49+
apiVersion: apps/v1
50+
kind: Deployment
51+
name: nginx
52+
minReplicas: 3
53+
maxReplicas: 10
54+
targetCPUUtilizationPercentage: 10

0 commit comments

Comments
 (0)