mirror of
https://github.com/openfaas/faas.git
synced 2025-06-19 04:26:35 +00:00
Extract scaling from zero
- extracting this package means it can be used in other components such as the asynchronous nats-queue-worker which may need to invoke functions which are scaled down to zero replicas. Ref: https://github.com/openfaas/nats-queue-worker/issues/32 Tested on Docker Swarm for scaling up, already scaled and not found error. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
fb06e299cf
commit
9cea08c728
21
gateway/scaling/range.go
Normal file
21
gateway/scaling/range.go
Normal file
@ -0,0 +1,21 @@
|
||||
package scaling
|
||||
|
||||
const (
|
||||
// DefaultMinReplicas is the minimal amount of replicas for a service.
|
||||
DefaultMinReplicas = 1
|
||||
|
||||
// DefaultMaxReplicas is the amount of replicas a service will auto-scale up to.
|
||||
DefaultMaxReplicas = 20
|
||||
|
||||
// DefaultScalingFactor is the defining proportion for the scaling increments.
|
||||
DefaultScalingFactor = 20
|
||||
|
||||
// MinScaleLabel label indicating min scale for a function
|
||||
MinScaleLabel = "com.openfaas.scale.min"
|
||||
|
||||
// MaxScaleLabel label indicating max scale for a function
|
||||
MaxScaleLabel = "com.openfaas.scale.max"
|
||||
|
||||
// ScalingFactorLabel label indicates the scaling factor for a function
|
||||
ScalingFactorLabel = "com.openfaas.scale.factor"
|
||||
)
|
Reference in New Issue
Block a user