70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
{{- if eq .Values.environment "prod" }}
|
|
apiVersion: temporal.io/v1alpha1
|
|
kind: WorkerResourceTemplate
|
|
metadata:
|
|
name: proteus-prod-hpa
|
|
namespace: proteus
|
|
spec:
|
|
workerDeploymentRef:
|
|
name: proteus-prod
|
|
template:
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
spec:
|
|
scaleTargetRef: {} # NOTE: controller injects the versioned Deployment
|
|
minReplicas: 2
|
|
maxReplicas: 10
|
|
metrics:
|
|
- type: External
|
|
external:
|
|
metric:
|
|
name: temporal_approximate_backlog_count
|
|
selector:
|
|
matchLabels:
|
|
task_type: "Activity"
|
|
target:
|
|
type: AverageValue
|
|
averageValue: "2"
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 70
|
|
{{- end }}
|
|
---
|
|
{{- if eq .Values.environment "beta" }}
|
|
apiVersion: temporal.io/v1alpha1
|
|
kind: WorkerResourceTemplate
|
|
metadata:
|
|
name: proteus-beta-hpa
|
|
namespace: proteus
|
|
spec:
|
|
workerDeploymentRef:
|
|
name: proteus-beta
|
|
template:
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
spec:
|
|
scaleTargetRef: {}
|
|
minReplicas: 1
|
|
maxReplicas: 2
|
|
metrics:
|
|
- type: External
|
|
external:
|
|
metric:
|
|
name: temporal_approximate_backlog_count
|
|
selector:
|
|
matchLabels:
|
|
task_type: "Activity"
|
|
target:
|
|
type: AverageValue
|
|
averageValue: "2"
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 70
|
|
{{- end }}
|