OutlierDetectionPolicy
OutlierDetectionPolicy API reference.
Proto: outlier_detection_policy.proto
Package: resilience.policy.gloo.solo.io
Configure Gloo to remove unhealthy destinations from the connection pool, and add the destinations back when they become healthy again.
Outlier detection is an important part of building resilient apps. An outlier detection policy sets up several conditions, such as retries and ejection percentages, that Gloo Mesh uses to determine if a service is unhealthy. In case an unhealthy service is detected, the outlier detection policy defines how Gloo Mesh removes (ejects) services from the pool of healthy destinations to send traffic to. For VirtualDestinations, traffic is not sent to deployments that are unavailable by default. Your apps then have time to recover before they are added back to the load-balancing pool and checked again for consecutive errors.
Outlier detection policies are applied at the Destination level. For more information, see the outlier detection policy guide.
Example
apiVersion: resilience.policy.gloo.solo.io/v2
kind: OutlierDetectionPolicy
metadata:
annotations:
cluster.solo.io/cluster: ""
name: outlier-detection
namespace: bookinfo
spec:
applyToDestinations:
- kind: VIRTUAL_DESTINATION
selector: {}
config:
baseEjectionTime: 30s
consecutiveErrors: 2
interval: 1s
maxEjectionPercent: 100
OutlierDetectionPolicyReport
The resources that the policy selects after it is successfully applied.
Field | Description |
---|---|
workspaces | (repeated OutlierDetectionPolicyReport.WorkspacesEntry )A list of workspaces in which the policy can apply to workloads. |
selectedDestinationPorts | (repeated common.gloo.solo.io.DestinationReference )A list of destination ports selected by the policy. |
OutlierDetectionPolicyReport.WorkspacesEntry
Field | Description |
---|---|
key | (string ) |
value | (common.gloo.solo.io.Report ) |
OutlierDetectionPolicySpec
Specifications for the policy.
Field | Description |
---|---|
applyToDestinations | (repeated common.gloo.solo.io.DestinationSelector )Destinations to apply the policy to. Implementation notes:
Configuration constraints: applyToDestinations.kind must equal either VIRTUAL_DESTINATION or EXTERNAL_SERVICE . |
config | (OutlierDetectionPolicySpec.Config )The details of the OutlierDetectionPolicy to apply to the selected destinations. |
OutlierDetectionPolicySpec.Config
The details of the OutlierDetectionPolicy to apply to the selected destinations.
Field | Description |
---|---|
consecutiveErrors | (google.protobuf.UInt32Value )The number of 5xx errors that can be returned before a destination is removed from the healthy connection pool. The default is 5. Configuration constraints:
|
interval | (google.protobuf.Duration )The amount of time between analyzing destinations for ejection. Defaults to 10s. Configuration constraints:
|
baseEjectionTime | (google.protobuf.Duration )The minimum time duration for ejection, or the time when a destination is considered unhealthy and not used for load balancing. Defaults to 30s. Configuration constraints:
|
maxEjectionPercent | (uint32 )The maximum percentage of destinations that can be removed from the healthy connection pool at a time. For example, if you have 10 total destinations that the policy selects, and you set this value to 50 percent, 5 destinations can be removed at once. At least 1 destination can always be removed, regardless of the value that you set. The default value is 100 .Configuration constraints: The value must be in the range 0 - 100, inclusive. If set to 0, the default Istio value, 10%, is used. |
consecutiveGatewayErrors | (google.protobuf.UInt32Value )The number of gateway errors before a host is ejected from the connection pool. Implementation notes:
Configuration constraints:
|
OutlierDetectionPolicyStatus
The status of the policy after it is applied to your Gloo environment.
Field | Description |
---|---|
common | (common.gloo.solo.io.Status )The state and workspace conditions of the applied resource. |
numSelectedDestinationPorts | (uint32 )The number of destination ports selected by the policy. |