mirror of
https://git.oceanpay.cc/danial/kami_apple_exchage.git
synced 2025-12-18 23:05:11 +00:00
Remove distributed crawler system and refactor backend to focus on Apple Gift Card Exchange functionality. Update deployment configurations and dependencies accordingly.
83 lines
1.8 KiB
YAML
83 lines
1.8 KiB
YAML
# Horizontal Pod Autoscaler for API服务
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: apple-exchange-api-hpa
|
|
namespace: apple-exchange
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: apple-exchange-api
|
|
minReplicas: 3
|
|
maxReplicas: 10
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 70
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 80
|
|
behavior:
|
|
scaleDown:
|
|
stabilizationWindowSeconds: 300
|
|
policies:
|
|
- type: Percent
|
|
value: 10
|
|
periodSeconds: 60
|
|
scaleUp:
|
|
stabilizationWindowSeconds: 60
|
|
policies:
|
|
- type: Percent
|
|
value: 50
|
|
periodSeconds: 60
|
|
---
|
|
# Horizontal Pod Autoscaler for Worker服务
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: apple-exchange-worker-hpa
|
|
namespace: apple-exchange
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: apple-exchange-worker
|
|
minReplicas: 2
|
|
maxReplicas: 20
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 75
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 85
|
|
behavior:
|
|
scaleDown:
|
|
stabilizationWindowSeconds: 600 # 更长的稳定窗口,避免频繁缩容
|
|
policies:
|
|
- type: Percent
|
|
value: 25
|
|
periodSeconds: 120
|
|
scaleUp:
|
|
stabilizationWindowSeconds: 120
|
|
policies:
|
|
- type: Percent
|
|
value: 100
|
|
periodSeconds: 60
|
|
- type: Pods
|
|
value: 5
|
|
periodSeconds: 60
|
|
selectPolicy: Max |