mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
Tweak alertmanager timeout + simplify down-scale of replicas
This commit is contained in:
parent
59ca597903
commit
cdd5219200
@ -32,12 +32,21 @@ func scaleService(req requests.PrometheusAlert, c *client.Client) error {
|
|||||||
} else {
|
} else {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else { // Resolved event.
|
||||||
replicas = *service.Spec.Mode.Replicated.Replicas - uint64(5)
|
// Previously decremented by 5, but event only fires once, so set to 1/1.
|
||||||
if replicas <= 0 {
|
if *service.Spec.Mode.Replicated.Replicas > 1 {
|
||||||
|
// replicas = *service.Spec.Mode.Replicated.Replicas - uint64(5)
|
||||||
|
// if replicas < 1 {
|
||||||
|
// replicas = 1
|
||||||
|
// }
|
||||||
|
// return nil
|
||||||
|
|
||||||
replicas = 1
|
replicas = 1
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Scaling %s to %d replicas.\n", serviceName, replicas)
|
log.Printf("Scaling %s to %d replicas.\n", serviceName, replicas)
|
||||||
|
|
||||||
service.Spec.Mode.Replicated.Replicas = &replicas
|
service.Spec.Mode.Replicated.Replicas = &replicas
|
||||||
|
@ -25,15 +25,15 @@ route:
|
|||||||
# This way ensures that you get multiple alerts for the same group that start
|
# This way ensures that you get multiple alerts for the same group that start
|
||||||
# firing shortly after another are batched together on the first
|
# firing shortly after another are batched together on the first
|
||||||
# notification.
|
# notification.
|
||||||
group_wait: 30s
|
group_wait: 5s
|
||||||
|
|
||||||
# When the first notification was sent, wait 'group_interval' to send a batch
|
# When the first notification was sent, wait 'group_interval' to send a batch
|
||||||
# of new alerts that started firing for that group.
|
# of new alerts that started firing for that group.
|
||||||
group_interval: 5m
|
group_interval: 10s
|
||||||
|
|
||||||
# If an alert has successfully been sent, wait 'repeat_interval' to
|
# If an alert has successfully been sent, wait 'repeat_interval' to
|
||||||
# resend them.
|
# resend them.
|
||||||
repeat_interval: 3h
|
repeat_interval: 30s
|
||||||
|
|
||||||
# A default receiver
|
# A default receiver
|
||||||
receiver: scale-up
|
receiver: scale-up
|
||||||
@ -66,3 +66,4 @@ receivers:
|
|||||||
webhook_configs:
|
webhook_configs:
|
||||||
- url: http://gateway:8080/system/alert
|
- url: http://gateway:8080/system/alert
|
||||||
send_resolved: true
|
send_resolved: true
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user