mirror of
https://github.com/openfaas/faas.git
synced 2025-06-28 01:33:24 +00:00
Feature for probing functions
Introduces a single-flight call to a function's health endpoint to verify that it is registered with an Istio sidecar (Envoy) before letting the invocation through. Results are cached for 5 seconds, before a probe is required again. Tested without Istio, with probe_functions environment variable set to true, I saw a probe execute in the logs. Fixes: #1721 for Istio users. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
committed by
Alex Ellis
parent
01841f605c
commit
88eea5f62e
@ -175,6 +175,8 @@ func (ReadConfig) Read(hasEnv HasEnv) (*GatewayConfig, error) {
|
||||
}
|
||||
}
|
||||
|
||||
cfg.ProbeFunctions = parseBoolValue(hasEnv.Getenv("probe_functions"))
|
||||
|
||||
return &cfg, nil
|
||||
}
|
||||
|
||||
@ -243,6 +245,9 @@ type GatewayConfig struct {
|
||||
|
||||
// Namespace for endpoints
|
||||
Namespace string
|
||||
|
||||
// ProbeFunctions requires the gateway to probe the health endpoint of a function before invoking it
|
||||
ProbeFunctions bool
|
||||
}
|
||||
|
||||
// UseNATS Use NATSor not
|
||||
|
Reference in New Issue
Block a user