Files
telecom-platform/deployments/autoscaling/hpa.yaml
T
nutcas3 2b2818a412 feat: Add HPA and VPA autoscaling configurations for telecom platform components
- Add api-server HPA with 2-10 replicas scaling on CPU (70%), memory (80%), HTTP requests (100/s), queue messages (1000)
- Add charging-engine HPA with 2-8 replicas scaling on CPU (75%), memory (85%), billing events (50/s)
- Add packet-gateway HPA with 2-12 replicas scaling on CPU (60%), memory (75%), packets (1000/s)
- Add web-dashboard HPA with 1-6 replicas scaling on CPU (70%), memory (80%), active sessions (50)
- Configure H
2026-04-17 17:20:15 +03:00

219 lines
4.6 KiB
YAML

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: api-server-hpa
namespace: telecom-platform
labels:
app.kubernetes.io/name: api-server-hpa
app.kubernetes.io/component: autoscaling
app.kubernetes.io/part-of: telecom-platform
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api-server
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
- type: Pods
pods:
metric:
name: http_requests_per_second
target:
type: AverageValue
averageValue: "100"
- type: Object
object:
metric:
name: queue_messages
describedObject:
apiVersion: v1
kind: Service
name: api-server
target:
type: Value
value: "1000"
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 10
periodSeconds: 60
- type: Pods
value: 2
periodSeconds: 60
selectPolicy: Min
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 50
periodSeconds: 60
- type: Pods
value: 4
periodSeconds: 60
selectPolicy: Max
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: charging-engine-hpa
namespace: telecom-platform
labels:
app.kubernetes.io/name: charging-engine-hpa
app.kubernetes.io/component: autoscaling
app.kubernetes.io/part-of: telecom-platform
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: charging-engine
minReplicas: 2
maxReplicas: 8
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 85
- type: Pods
pods:
metric:
name: billing_events_per_second
target:
type: AverageValue
averageValue: "50"
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 10
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
periodSeconds: 60
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: packet-gateway-hpa
namespace: telecom-platform
labels:
app.kubernetes.io/name: packet-gateway-hpa
app.kubernetes.io/component: autoscaling
app.kubernetes.io/part-of: telecom-platform
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: packet-gateway
minReplicas: 2
maxReplicas: 12
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 60
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 75
- type: Pods
pods:
metric:
name: packets_per_second
target:
type: AverageValue
averageValue: "1000"
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 15
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 30
policies:
- type: Percent
value: 200
periodSeconds: 60
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-dashboard-hpa
namespace: telecom-platform
labels:
app.kubernetes.io/name: web-dashboard-hpa
app.kubernetes.io/component: autoscaling
app.kubernetes.io/part-of: telecom-platform
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web-dashboard
minReplicas: 1
maxReplicas: 6
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
- type: Pods
pods:
metric:
name: active_sessions
target:
type: AverageValue
averageValue: "50"
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 20
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
periodSeconds: 60