java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
io.envoyproxy.envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, OverrideHostOrBuilder, Cloneable
Enclosing class:
OverrideHost

public static final class OverrideHost.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder> implements OverrideHostOrBuilder
 Configuration for the Override Host Load Balancing policy.

 This policy allows endpoint picking to be implemented in downstream HTTP filters. For example an ext_proc RPC to a service
 that implements k8s proposal for AI gateway inferences extensions
 https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/docs/proposals/004-endpoint-picker-protocol
 can provide hosts for serving a request using Override Host load balancing policy.

 This policy extracts selected override hosts from a list of ``OverrideHostSource`` (request headers, metadata, etc.).

 The override host source must specify at least one host in ``IP:Port`` format or multiple hosts in ``IP:Port,IP:Port,...``
 format. For example ``10.0.0.5:8080`` or ``[2600:4040:5204::1574:24ae]:80``. The IPv6 address is enclosed in square brackets.

 For specific example, to support k8s gateway inference extensions, which uses the ``x-gateway-destination-endpoint``
 header or metadata value under the "envoy.lb" key for selected hosts, the Override Host load balancing policy should be
 configured in the following way:

 .. code-block:: yaml

    override_host_sources:
      - header: "x-gateway-destination-endpoint"
      - metadata:
          key: "envoy.lb"
          path:
          - key: "x-gateway-destination-endpoint"

 If no valid host in the override host list, then the specified fallback load balancing policy is used. This allows load
 balancing to degrade to a a built in policy (i.e. Round Robin) in case external endpoint picker fails.

 See the :ref:`load balancing architecture
 overview<arch_overview_load_balancing_types>` for more information.
 
Protobuf type envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • clear

      public OverrideHost.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • getDefaultInstanceForType

      public OverrideHost getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public OverrideHost build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public OverrideHost buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public OverrideHost.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • setField

      public OverrideHost.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • clearField

      public OverrideHost.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • clearOneof

      public OverrideHost.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • setRepeatedField

      public OverrideHost.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • addRepeatedField

      public OverrideHost.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • mergeFrom

      public OverrideHost.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<OverrideHost.Builder>
    • mergeFrom

      public OverrideHost.Builder mergeFrom(OverrideHost other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • mergeFrom

      public OverrideHost.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<OverrideHost.Builder>
      Throws:
      IOException
    • getOverrideHostSourcesList

      public List<OverrideHost.OverrideHostSource> getOverrideHostSourcesList()
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
      Specified by:
      getOverrideHostSourcesList in interface OverrideHostOrBuilder
    • getOverrideHostSourcesCount

      public int getOverrideHostSourcesCount()
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
      Specified by:
      getOverrideHostSourcesCount in interface OverrideHostOrBuilder
    • getOverrideHostSources

      public OverrideHost.OverrideHostSource getOverrideHostSources(int index)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
      Specified by:
      getOverrideHostSources in interface OverrideHostOrBuilder
    • setOverrideHostSources

      public OverrideHost.Builder setOverrideHostSources(int index, OverrideHost.OverrideHostSource value)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • setOverrideHostSources

      public OverrideHost.Builder setOverrideHostSources(int index, OverrideHost.OverrideHostSource.Builder builderForValue)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • addOverrideHostSources

      public OverrideHost.Builder addOverrideHostSources(OverrideHost.OverrideHostSource value)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • addOverrideHostSources

      public OverrideHost.Builder addOverrideHostSources(int index, OverrideHost.OverrideHostSource value)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • addOverrideHostSources

      public OverrideHost.Builder addOverrideHostSources(OverrideHost.OverrideHostSource.Builder builderForValue)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • addOverrideHostSources

      public OverrideHost.Builder addOverrideHostSources(int index, OverrideHost.OverrideHostSource.Builder builderForValue)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • addAllOverrideHostSources

      public OverrideHost.Builder addAllOverrideHostSources(Iterable<? extends OverrideHost.OverrideHostSource> values)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • clearOverrideHostSources

      public OverrideHost.Builder clearOverrideHostSources()
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • removeOverrideHostSources

      public OverrideHost.Builder removeOverrideHostSources(int index)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • getOverrideHostSourcesBuilder

      public OverrideHost.OverrideHostSource.Builder getOverrideHostSourcesBuilder(int index)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • getOverrideHostSourcesOrBuilder

      public OverrideHost.OverrideHostSourceOrBuilder getOverrideHostSourcesOrBuilder(int index)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
      Specified by:
      getOverrideHostSourcesOrBuilder in interface OverrideHostOrBuilder
    • getOverrideHostSourcesOrBuilderList

      public List<? extends OverrideHost.OverrideHostSourceOrBuilder> getOverrideHostSourcesOrBuilderList()
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
      Specified by:
      getOverrideHostSourcesOrBuilderList in interface OverrideHostOrBuilder
    • addOverrideHostSourcesBuilder

      public OverrideHost.OverrideHostSource.Builder addOverrideHostSourcesBuilder()
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • addOverrideHostSourcesBuilder

      public OverrideHost.OverrideHostSource.Builder addOverrideHostSourcesBuilder(int index)
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • getOverrideHostSourcesBuilderList

      public List<OverrideHost.OverrideHostSource.Builder> getOverrideHostSourcesBuilderList()
       A list of sources to get host addresses from. The host sources are searched in the order
       specified. The request is forwarded to the first address and subsequent addresses are used
       for request retries or hedging.
       Note that if an overridden host address is not present in the current endpoint set, it is
       skipped and the next found address is used. If there are not enough overridden addresses to
       satisfy all retry attempts the fallback load balancing policy is used to pick a host.
       
      repeated .envoy.extensions.load_balancing_policies.override_host.v3.OverrideHost.OverrideHostSource override_host_sources = 1 [(.validate.rules) = { ... }
    • hasFallbackPolicy

      public boolean hasFallbackPolicy()
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
      Specified by:
      hasFallbackPolicy in interface OverrideHostOrBuilder
      Returns:
      Whether the fallbackPolicy field is set.
    • getFallbackPolicy

      public LoadBalancingPolicy getFallbackPolicy()
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
      Specified by:
      getFallbackPolicy in interface OverrideHostOrBuilder
      Returns:
      The fallbackPolicy.
    • setFallbackPolicy

      public OverrideHost.Builder setFallbackPolicy(LoadBalancingPolicy value)
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
    • setFallbackPolicy

      public OverrideHost.Builder setFallbackPolicy(LoadBalancingPolicy.Builder builderForValue)
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
    • mergeFallbackPolicy

      public OverrideHost.Builder mergeFallbackPolicy(LoadBalancingPolicy value)
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
    • clearFallbackPolicy

      public OverrideHost.Builder clearFallbackPolicy()
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
    • getFallbackPolicyBuilder

      public LoadBalancingPolicy.Builder getFallbackPolicyBuilder()
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
    • getFallbackPolicyOrBuilder

      public LoadBalancingPolicyOrBuilder getFallbackPolicyOrBuilder()
       The child LB policy to use in case neither header nor metadata with selected
       hosts is present.
       
      .envoy.config.cluster.v3.LoadBalancingPolicy fallback_policy = 3 [(.validate.rules) = { ... }
      Specified by:
      getFallbackPolicyOrBuilder in interface OverrideHostOrBuilder
    • setUnknownFields

      public final OverrideHost.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>
    • mergeUnknownFields

      public final OverrideHost.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<OverrideHost.Builder>