Co-authored-by: matst80 <mats.tornberg@gmail.com> Reviewed-on: https://git.tornberg.me/mats/go-cart-actor/pulls/4 Co-authored-by: Mats Törnberg <mats@tornberg.me> Co-committed-by: Mats Törnberg <mats@tornberg.me>
102 lines
2.7 KiB
YAML
102 lines
2.7 KiB
YAML
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: cart-scaler-amd
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: cart-actor-x86
|
|
minReplicas: 3
|
|
maxReplicas: 9
|
|
behavior:
|
|
scaleUp:
|
|
stabilizationWindowSeconds: 60
|
|
policies:
|
|
- type: Percent
|
|
value: 100
|
|
periodSeconds: 60
|
|
scaleDown:
|
|
stabilizationWindowSeconds: 180
|
|
policies:
|
|
- type: Percent
|
|
value: 50
|
|
periodSeconds: 60
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 50
|
|
# Future custom metric (example):
|
|
# - type: Pods
|
|
# pods:
|
|
# metric:
|
|
# name: cart_mutations_per_second
|
|
# target:
|
|
# type: AverageValue
|
|
# averageValue: "15"
|
|
# - type: Object
|
|
# object:
|
|
# describedObject:
|
|
# apiVersion: networking.k8s.io/v1
|
|
# kind: Ingress
|
|
# name: cart-ingress
|
|
# metric:
|
|
# name: http_requests_per_second
|
|
# target:
|
|
# type: Value
|
|
# value: "100"
|
|
---
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: cart-scaler-arm
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: cart-actor-arm64
|
|
minReplicas: 3
|
|
maxReplicas: 9
|
|
behavior:
|
|
scaleUp:
|
|
stabilizationWindowSeconds: 60
|
|
policies:
|
|
- type: Percent
|
|
value: 100
|
|
periodSeconds: 60
|
|
scaleDown:
|
|
stabilizationWindowSeconds: 180
|
|
policies:
|
|
- type: Percent
|
|
value: 50
|
|
periodSeconds: 60
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 50
|
|
# Future custom metric (example):
|
|
# - type: Pods
|
|
# pods:
|
|
# metric:
|
|
# name: cart_mutations_per_second
|
|
# target:
|
|
# type: AverageValue
|
|
# averageValue: "15"
|
|
# - type: Object
|
|
# object:
|
|
# describedObject:
|
|
# apiVersion: networking.k8s.io/v1
|
|
# kind: Ingress
|
|
# name: cart-ingress
|
|
# metric:
|
|
# name: http_requests_per_second
|
|
# target:
|
|
# type: Value
|
|
# value: "100"
|