first commit

This commit is contained in:
Blendman974 committed 2023-07-12 09:05:54 +04:00
commit ef794d5b9c
3 files changed
+81

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: apache-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: apache
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
behavior:
scaleDown:
stabilizationWindowSeconds: 30
policies:
- type: Pods
value: 1
periodSeconds: 10
+36
View File
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: apache
spec:
selector:
matchLabels:
app: apache
replicas: 1
template:
metadata:
labels:
app: apache
spec:
containers:
- name: apache
image: k8s.gcr.io/hpa-example
ports:
- containerPort: 80
resources:
limits:
cpu: 500m
requests:
cpu: 200m
---
apiVersion: v1
kind: Service
metadata:
name: apache
labels:
app: apache
spec:
ports:
- port: 80
selector:
app: apache
+20
View File
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: load-generator
spec:
replicas: 1
selector:
matchLabels:
app: load-generator
template:
metadata:
labels:
app: load-generator
spec:
containers:
- name: load-generator
image: busybox
command: ["/bin/sh", "-c"]
args:
- while sleep 0.01; do wget -q -O- http://apache; done