-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooocus_autoscaling.tf
More file actions
56 lines (48 loc) · 1.09 KB
/
fooocus_autoscaling.tf
File metadata and controls
56 lines (48 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
resource "kubernetes_horizontal_pod_autoscaler_v2" "fooocus_gpu_utilization_hpa" {
count = var.enable_autoscaling ? 1 : 0
metadata {
name = "gpu-utilization-hpa"
namespace = "fooocus"
}
spec {
scale_target_ref {
api_version = "apps/v1"
kind = "Deployment"
name = "fooocus-deployment"
}
min_replicas = 1
max_replicas = 5
metric {
type = "Pods"
pods {
metric {
name = "gpu_utilization"
}
target {
type = "AverageValue"
average_value = "500m"
}
}
}
behavior {
scale_up {
stabilization_window_seconds = 30
select_policy = "Max"
policy {
type = "Pods"
value = 2
period_seconds = 60
}
}
scale_down {
stabilization_window_seconds = 60
select_policy = "Min"
policy {
type = "Percent"
value = 50
period_seconds = 60
}
}
}
}
}