Proto: failover_policy.proto


Use a failover policy to determine where to reroute traffic in case of failure. If a backing service in a virtual destination is unhealthy, Gloo Mesh re-routes traffic to another healthy backing service by locality, as specified in the FailoverPolicy config. FailoverPolicies are applied at the Destination level.

Note that you can use failover policies in combination with other policies, such as outlier detection or retry policies. In case of a failure, the failover policy tells Gloo Mesh which healthy destinations to reroute traffic to, based on the closest locality. The outlier detection policy tells Gloo Mesh when and for how long to remove unhealthy services. The retry policy tells Gloo Mesh how many times to retry requests before the outlier detection policy considers the request as failing and removes the service from the pool of healthy destinations.

Example: This example selects all virtual destinations in the workspace, and fails over traffic from any destinations served in the us-east region to any matching destinations only in the us-west region.

kind: FailoverPolicy
  annotations: ""
  name: locality-based-failover
  namespace: bookinfo
    selector: {}
    - from:
        region: us-east
      - region: us-west



Field Description
destination (

The destination to which the selected outlier detection policy is applied.
selectedOutlierDetection (

The selected outlier detection policy.


The report shows the resources that the policy selects after the policy is successfully applied.

Field Description
workspaces (repeated FailoverPolicyReport.WorkspacesEntry)

A list of workloads selected by the policy.
selectedDestinationPorts (repeated

A list of destination ports selected by the policy.
correspondingOutlierDetectionPolicies (repeated DestinationToSelectedOutlierDetection)

A list of selected outlier detection policies.


Field Description
key (string)

value (


Specifications for the policy.

Field Description
applyToDestinations (repeated

Select the virtual destinations to apply the policy to by using labels. If empty, the policy applies to all vitrual destinations in the workspace.
Failover policies can currently select Gloo virtual destinations only. Selecting Kubernetes services or Gloo external services is not supported.
config (FailoverPolicySpec.Config)

The details of the failover policy to apply to the selected virtual destinations.


Field Description
localityMappings (repeated FailoverPolicySpec.Config.LocalityMappings)

Map the localities to fail over traffic from one region, zone, or subzone to another in case of failure. The locality is determined by the Kubernetes labels on the node where the destination's app runs. For more information, see the Istio docs.
You can exclude this setting to enable the locality load balancer settings without mappings.
Only priority labels or locality mappings can be specified, not both.
priorityLabels (FailoverPolicySpec.Config.PriorityLabels)

Prioritize destinations to fail over traffic to by configuring priority labels. In general, destinations that match the most labels have higher priority during failover. For more information, see the Istio docs.
When using priority labels, you must specify either an ordered list of label keys or an ordered list of label key-value pairs. For example, you can specify ["region"] or ["region=us-east-1", "availabilityzone=1a", "datacenter=4"]. You cannot have an ordered list that includes both label keys and label key-value pairs.
Only priority labels or locality mappings can be specified, not both. If you specify both, Gloo Mesh will give precedence to the locality mappings. You can use locality labels in your list of priority labels, such as the Kubernetes node label.


Field Description
from (FailoverPolicySpec.Config.LocalityMappings.OriginatingLocality)

The locality of the destination where Gloo Mesh originally tried to fulfill the request.
to (repeated FailoverPolicySpec.Config.LocalityMappings.DestinationLocality)

The localities of the destination where Gloo Mesh can reroute requests. You must specify the region, and optionally the zone and subzone. If you have multiple to destinations, you can optionally set a weight.


A geographic location defined by a region, zone, and sub-zone along with the weight for the destination.

Field Description
region (string)

The locality's region.
zone (string)

(Optional) The locality's zone.
subZone (string)

(Optional) The locality's sub-zone.
weight (google.protobuf.UInt32Value)

(Optional) Weight for destination locality. All weights must add up to 100. If not provided, weight is determined based on other destination locality weights. For information about the value format, see the Google protocol buffer documentation.


A geographic location defined by a region, zone, and sub-zone.

Field Description
region (string)

The locality's region.
zone (string)

(Optional) The locality's zone.
subZone (string)

(Optional) The locality's sub-zone.


Field Description
labels (repeated string)


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

Field Description
common (

The state and workspace conditions of the applied resource.
numSelectedDestinationPorts (uint32)

The number of destination ports selected by the policy.