Skip to content

Commit 804968d

Browse files
committed
created a yaml file for HPA
Signed-off-by: Rajdeep Pal <[email protected]>
1 parent 10d034a commit 804968d

File tree

1 file changed

+33
-0
lines changed
  • charts/vineyard-operator/templates

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: vineyard-memory-hpa
5+
namespace: vineyard-system
6+
spec:
7+
scaleTargetRef:
8+
apiVersion: apps/v1
9+
kind: Deployment
10+
name: vineyard-controller-manager
11+
minReplicas: 2
12+
maxReplicas: 10
13+
metrics:
14+
- type: Resource
15+
resource:
16+
name: memory
17+
target:
18+
type: Utilization
19+
averageUtilization: 50 # Target 50% memory usage
20+
behavior:
21+
scaleUp:
22+
policies:
23+
- type: Pods
24+
value: 2 # Add 2 pods at once when scaling up
25+
periodSeconds: 15 # Check frequently during scale-up
26+
selectPolicy: Max
27+
stabilizationWindowSeconds: 0 # React immediately to spikes
28+
scaleDown:
29+
policies:
30+
- type: Percent
31+
value: 50 # Remove up to 50% of pods at once
32+
periodSeconds: 60
33+
stabilizationWindowSeconds: 300 # Wait 5 minutes before scaling down

0 commit comments

Comments
 (0)