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.

FieldDescription
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

FieldDescription
key(string)

value(common.gloo.solo.io.Report)

OutlierDetectionPolicySpec

Specifications for the policy.

FieldDescription
applyToDestinations(repeated common.gloo.solo.io.DestinationSelector)

Destinations to apply the policy to.

Implementation notes:
  • If empty, the policy applies to all destinations in the workspace.
  • The outlier detection policy currently supports selecting Gloo virtual destinations. Selecting Kubernetes services is not supported. To select a Gloo external service, the external service must refer to a service that is outside the service mesh but within the same cluster environment. Selecting Gloo external services that refer to a service outside the cluster is not supported.

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.

FieldDescription
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:
  • The value must be an integer or decimal value and a preferred unit, or multiple of these concatenated. Examples: 1m, 1h, 1.5h, 1s500ms
  • The value cannot have granularity smaller than one millisecond.
  • The value must be at least 1ms.
  • For information about the value format, see the ParseDuration documentation.
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:
  • The value must be an integer or decimal value and a preferred unit, or multiple of these concatenated. Examples: 1m, 1h, 1.5h, 1s500ms
  • The value cannot have granularity smaller than one millisecond.
  • The value must be at least 1ms.
  • For information about the value format, see the ParseDuration documentation.
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:
  • When the upstream host is accessed over HTTP, a 502, 503, or 504 reponse code qualifies as a gateway error.
  • When the upstream host is accessed over an opaque TCP connection, connection timeouts and connection error/failure events qualify as a gateway error.
  • This feature is disabled by default or when set to the value 0.
  • This field (consecutiveGatewayErrors) and consecutiveErrors can be used separately or together. Because the errors counted by consecutiveGatewayErrors are also included in consecutiveErrors, if the value of consecutiveGatewayErrors is greater than or equal to the value of consecutiveErrors, consecutiveGatewayErrors has no effect.

Configuration constraints:

OutlierDetectionPolicyStatus

The status of the policy after it is applied to your Gloo environment.

FieldDescription
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.