subsetv3

package
v0.0.0-...-ccdcd90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Subset_LbSubsetFallbackPolicy_name = map[int32]string{
		0: "NO_FALLBACK",
		1: "ANY_ENDPOINT",
		2: "DEFAULT_SUBSET",
	}
	Subset_LbSubsetFallbackPolicy_value = map[string]int32{
		"NO_FALLBACK":    0,
		"ANY_ENDPOINT":   1,
		"DEFAULT_SUBSET": 2,
	}
)

Enum value maps for Subset_LbSubsetFallbackPolicy.

View Source
var (
	Subset_LbSubsetMetadataFallbackPolicy_name = map[int32]string{
		0: "METADATA_NO_FALLBACK",
		1: "FALLBACK_LIST",
	}
	Subset_LbSubsetMetadataFallbackPolicy_value = map[string]int32{
		"METADATA_NO_FALLBACK": 0,
		"FALLBACK_LIST":        1,
	}
)

Enum value maps for Subset_LbSubsetMetadataFallbackPolicy.

View Source
var (
	Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy_name = map[int32]string{
		0: "NOT_DEFINED",
		1: "NO_FALLBACK",
		2: "ANY_ENDPOINT",
		3: "DEFAULT_SUBSET",
		4: "KEYS_SUBSET",
	}
	Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy_value = map[string]int32{
		"NOT_DEFINED":    0,
		"NO_FALLBACK":    1,
		"ANY_ENDPOINT":   2,
		"DEFAULT_SUBSET": 3,
		"KEYS_SUBSET":    4,
	}
)

Enum value maps for Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy.

View Source
var File_envoy_extensions_load_balancing_policies_subset_v3_subset_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Subset

type Subset struct {

	// The behavior used when no endpoint subset matches the selected route's
	// metadata. The value defaults to
	// :ref:`NO_FALLBACK<envoy_v3_api_enum_value_extensions.load_balancing_policies.subset.v3.Subset.LbSubsetFallbackPolicy.NO_FALLBACK>`.
	FallbackPolicy Subset_LbSubsetFallbackPolicy `` /* 190-byte string literal not displayed */
	// Specifies the default subset of endpoints used during fallback if
	// fallback_policy is
	// :ref:`DEFAULT_SUBSET<envoy_v3_api_enum_value_extensions.load_balancing_policies.subset.v3.Subset.LbSubsetFallbackPolicy.DEFAULT_SUBSET>`.
	// Each field in default_subset is
	// compared to the matching LbEndpoint.Metadata under the “envoy.lb“
	// namespace. It is valid for no hosts to match, in which case the behavior
	// is the same as a fallback_policy of
	// :ref:`NO_FALLBACK<envoy_v3_api_enum_value_extensions.load_balancing_policies.subset.v3.Subset.LbSubsetFallbackPolicy.NO_FALLBACK>`.
	DefaultSubset *structpb.Struct `protobuf:"bytes,2,opt,name=default_subset,json=defaultSubset,proto3" json:"default_subset,omitempty"`
	// For each entry, LbEndpoint.Metadata's
	// “envoy.lb“ namespace is traversed and a subset is created for each unique
	// combination of key and value. For example:
	//
	// .. code-block:: json
	//
	//	{ "subset_selectors": [
	//	    { "keys": [ "version" ] },
	//	    { "keys": [ "stage", "hardware_type" ] }
	//	]}
	//
	// A subset is matched when the metadata from the selected route and
	// weighted cluster contains the same keys and values as the subset's
	// metadata. The same host may appear in multiple subsets.
	SubsetSelectors []*Subset_LbSubsetSelector `protobuf:"bytes,3,rep,name=subset_selectors,json=subsetSelectors,proto3" json:"subset_selectors,omitempty"`
	// By default, only when the request metadata has exactly the **same** keys as one of subset selectors and
	// the values of the related keys are matched, the load balancer will have a valid subset for the request.
	// For example, given the following subset selectors:
	//
	// .. code-block:: json
	//
	//	{ "subset_selectors": [
	//	    { "keys": [ "version" ] },
	//	    { "keys": [ "stage", "version" ] }
	//	]}
	//
	// A request with metadata “{"redundant-key": "redundant-value", "stage": "prod", "version": "v1"}“ or
	// “{"redundant-key": "redundant-value", "version": "v1"}“ will not have a valid subset even if the values
	// of keys “stage“ and “version“ are matched because of the redundant key/value pair in the request
	// metadata.
	//
	// By setting this field to true, the most appropriate keys will be filtered out from the request metadata
	// according to the subset selectors. And then the filtered keys and related values will be matched to find
	// the valid host subset. By this way, redundant key/value pairs are allowed in the request metadata. The keys
	// of a request metadata could be superset of the keys of the subset selectors and need not to be exactly the
	// same as the keys of the subset selectors.
	//
	// More specifically, if the keys of a request metadata is a superset of one of the subset selectors, then only
	// the values of the keys that in the selector keys will be matched. Take the above example, if the request
	// metadata is “{"redundant-key": "redundant-value", "stage": "prod", "version": "v1"}“, the load balancer
	// will only match the values of “stage“ and “version“ to find an appropriate subset because “stage“
	// “version“ are contained by the second subset selector and the redundant “redundant-key“ will be
	// ignored.
	//
	// .. note::
	//
	//	If the keys of request metadata is superset of multiple different subset selectors keys, the subset
	//	selector with most keys to win. For example, given subset selectors
	//	“{"subset_selectors": ["keys": ["A", "B", "C"], ["A", "B"]]}“ and request metadata “{"A": "-",
	//	"B": "-", "C": "-", "D": "-"}“, keys “A“, “B“, “C“ will be evaluated.
	//	If the keys of request metadata is superset of multiple different subset selectors keys and the number
	//	of selector keys are same, then the one placed in front to win. For example, given subset selectors
	//	“{"subset_selectors": ["keys": ["A", "B"], ["C", "D"]]}“ and request metadata “{"A": "-", "B": "-",
	//	"C": "-", "D": "-"}“, keys “A“, “B“ will be evaluated.
	AllowRedundantKeys bool `protobuf:"varint,10,opt,name=allow_redundant_keys,json=allowRedundantKeys,proto3" json:"allow_redundant_keys,omitempty"`
	// If true, routing to subsets will take into account the localities and locality weights of the
	// endpoints when making the routing decision.
	//
	// There are some potential pitfalls associated with enabling this feature, as the resulting
	// traffic split after applying both a subset match and locality weights might be undesirable.
	//
	// Consider for example a situation in which you have 50/50 split across two localities X/Y
	// which have 100 hosts each without subsetting. If the subset LB results in X having only 1
	// host selected but Y having 100, then a lot more load is being dumped on the single host in X
	// than originally anticipated in the load balancing assignment delivered via EDS.
	LocalityWeightAware bool `protobuf:"varint,4,opt,name=locality_weight_aware,json=localityWeightAware,proto3" json:"locality_weight_aware,omitempty"`
	// When used with locality_weight_aware, scales the weight of each locality by the ratio
	// of hosts in the subset vs hosts in the original subset. This aims to even out the load
	// going to an individual locality if said locality is disproportionately affected by the
	// subset predicate.
	ScaleLocalityWeight bool `protobuf:"varint,5,opt,name=scale_locality_weight,json=scaleLocalityWeight,proto3" json:"scale_locality_weight,omitempty"`
	// If true, when a fallback policy is configured and its corresponding subset fails to find
	// a host this will cause any host to be selected instead.
	//
	// This is useful when using the default subset as the fallback policy, given the default
	// subset might become empty. With this option enabled, if that happens the LB will attempt
	// to select a host from the entire cluster.
	PanicModeAny bool `protobuf:"varint,6,opt,name=panic_mode_any,json=panicModeAny,proto3" json:"panic_mode_any,omitempty"`
	// If true, metadata specified for a metadata key will be matched against the corresponding
	// endpoint metadata if the endpoint metadata matches the value exactly OR it is a list value
	// and any of the elements in the list matches the criteria.
	ListAsAny bool `protobuf:"varint,7,opt,name=list_as_any,json=listAsAny,proto3" json:"list_as_any,omitempty"`
	// Fallback mechanism that allows to try different route metadata until a host is found.
	// If load balancing process, including all its mechanisms (like
	// :ref:`fallback_policy<envoy_v3_api_field_extensions.load_balancing_policies.subset.v3.subset.fallback_policy>`)
	// fails to select a host, this policy decides if and how the process is repeated using another metadata.
	//
	// The value defaults to
	// :ref:`METADATA_NO_FALLBACK
	// <envoy_v3_api_enum_value_extensions.load_balancing_policies.subset.v3.subset.LbSubsetMetadataFallbackPolicy.METADATA_NO_FALLBACK>`.
	MetadataFallbackPolicy Subset_LbSubsetMetadataFallbackPolicy `` /* 224-byte string literal not displayed */
	// The child LB policy to create for endpoint-picking within the chosen subset.
	SubsetLbPolicy *v3.LoadBalancingPolicy `protobuf:"bytes,9,opt,name=subset_lb_policy,json=subsetLbPolicy,proto3" json:"subset_lb_policy,omitempty"`
	// contains filtered or unexported fields
}

Optionally divide the endpoints in this cluster into subsets defined by endpoint metadata and selected by route and weighted cluster metadata. [#next-free-field: 11]

func (*Subset) Descriptor deprecated

func (*Subset) Descriptor() ([]byte, []int)

Deprecated: Use Subset.ProtoReflect.Descriptor instead.

func (*Subset) GetAllowRedundantKeys

func (x *Subset) GetAllowRedundantKeys() bool

func (*Subset) GetDefaultSubset

func (x *Subset) GetDefaultSubset() *structpb.Struct

func (*Subset) GetFallbackPolicy

func (x *Subset) GetFallbackPolicy() Subset_LbSubsetFallbackPolicy

func (*Subset) GetListAsAny

func (x *Subset) GetListAsAny() bool

func (*Subset) GetLocalityWeightAware

func (x *Subset) GetLocalityWeightAware() bool

func (*Subset) GetMetadataFallbackPolicy

func (x *Subset) GetMetadataFallbackPolicy() Subset_LbSubsetMetadataFallbackPolicy

func (*Subset) GetPanicModeAny

func (x *Subset) GetPanicModeAny() bool

func (*Subset) GetScaleLocalityWeight

func (x *Subset) GetScaleLocalityWeight() bool

func (*Subset) GetSubsetLbPolicy

func (x *Subset) GetSubsetLbPolicy() *v3.LoadBalancingPolicy

func (*Subset) GetSubsetSelectors

func (x *Subset) GetSubsetSelectors() []*Subset_LbSubsetSelector

func (*Subset) ProtoMessage

func (*Subset) ProtoMessage()

func (*Subset) ProtoReflect

func (x *Subset) ProtoReflect() protoreflect.Message

func (*Subset) Reset

func (x *Subset) Reset()

func (*Subset) String

func (x *Subset) String() string

func (*Subset) Validate

func (m *Subset) Validate() error

Validate checks the field values on Subset with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Subset) ValidateAll

func (m *Subset) ValidateAll() error

ValidateAll checks the field values on Subset with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SubsetMultiError, or nil if none found.

type SubsetMultiError

type SubsetMultiError []error

SubsetMultiError is an error wrapping multiple validation errors returned by Subset.ValidateAll() if the designated constraints aren't met.

func (SubsetMultiError) AllErrors

func (m SubsetMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SubsetMultiError) Error

func (m SubsetMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SubsetValidationError

type SubsetValidationError struct {
	// contains filtered or unexported fields
}

SubsetValidationError is the validation error returned by Subset.Validate if the designated constraints aren't met.

func (SubsetValidationError) Cause

func (e SubsetValidationError) Cause() error

Cause function returns cause value.

func (SubsetValidationError) Error

func (e SubsetValidationError) Error() string

Error satisfies the builtin error interface

func (SubsetValidationError) ErrorName

func (e SubsetValidationError) ErrorName() string

ErrorName returns error name.

func (SubsetValidationError) Field

func (e SubsetValidationError) Field() string

Field function returns field value.

func (SubsetValidationError) Key

func (e SubsetValidationError) Key() bool

Key function returns key value.

func (SubsetValidationError) Reason

func (e SubsetValidationError) Reason() string

Reason function returns reason value.

type Subset_LbSubsetFallbackPolicy

type Subset_LbSubsetFallbackPolicy int32

If NO_FALLBACK is selected, a result equivalent to no healthy hosts is reported. If ANY_ENDPOINT is selected, any cluster endpoint may be returned (subject to policy, health checks, etc). If DEFAULT_SUBSET is selected, load balancing is performed over the endpoints matching the values from the default_subset field.

const (
	Subset_NO_FALLBACK    Subset_LbSubsetFallbackPolicy = 0
	Subset_ANY_ENDPOINT   Subset_LbSubsetFallbackPolicy = 1
	Subset_DEFAULT_SUBSET Subset_LbSubsetFallbackPolicy = 2
)

func (Subset_LbSubsetFallbackPolicy) Descriptor

func (Subset_LbSubsetFallbackPolicy) Enum

func (Subset_LbSubsetFallbackPolicy) EnumDescriptor deprecated

func (Subset_LbSubsetFallbackPolicy) EnumDescriptor() ([]byte, []int)

Deprecated: Use Subset_LbSubsetFallbackPolicy.Descriptor instead.

func (Subset_LbSubsetFallbackPolicy) Number

func (Subset_LbSubsetFallbackPolicy) String

func (Subset_LbSubsetFallbackPolicy) Type

type Subset_LbSubsetMetadataFallbackPolicy

type Subset_LbSubsetMetadataFallbackPolicy int32
const (
	// No fallback. Route metadata will be used as-is.
	Subset_METADATA_NO_FALLBACK Subset_LbSubsetMetadataFallbackPolicy = 0
	// A special metadata key “fallback_list“ will be used to provide variants of metadata to try.
	// Value of “fallback_list“ key has to be a list. Every list element has to be a struct - it will
	// be merged with route metadata, overriding keys that appear in both places.
	// “fallback_list“ entries will be used in order until a host is found.
	//
	// “fallback_list“ key itself is removed from metadata before subset load balancing is performed.
	//
	// Example:
	//
	// for metadata:
	//
	// .. code-block:: yaml
	//
	//	version: 1.0
	//	fallback_list:
	//	  - version: 2.0
	//	    hardware: c64
	//	  - hardware: c32
	//	  - version: 3.0
	//
	// at first, metadata:
	//
	// .. code-block:: json
	//
	//	{"version": "2.0", "hardware": "c64"}
	//
	// will be used for load balancing. If no host is found, metadata:
	//
	// .. code-block:: json
	//
	//	{"version": "1.0", "hardware": "c32"}
	//
	// is next to try. If it still results in no host, finally metadata:
	//
	// .. code-block:: json
	//
	//	{"version": "3.0"}
	//
	// is used.
	Subset_FALLBACK_LIST Subset_LbSubsetMetadataFallbackPolicy = 1
)

func (Subset_LbSubsetMetadataFallbackPolicy) Descriptor

func (Subset_LbSubsetMetadataFallbackPolicy) Enum

func (Subset_LbSubsetMetadataFallbackPolicy) EnumDescriptor deprecated

func (Subset_LbSubsetMetadataFallbackPolicy) EnumDescriptor() ([]byte, []int)

Deprecated: Use Subset_LbSubsetMetadataFallbackPolicy.Descriptor instead.

func (Subset_LbSubsetMetadataFallbackPolicy) Number

func (Subset_LbSubsetMetadataFallbackPolicy) String

func (Subset_LbSubsetMetadataFallbackPolicy) Type

type Subset_LbSubsetSelector

type Subset_LbSubsetSelector struct {

	// List of keys to match with the weighted cluster metadata.
	Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
	// Selects a mode of operation in which each subset has only one host. This mode uses the same rules for
	// choosing a host, but updating hosts is faster, especially for large numbers of hosts.
	//
	// If a match is found to a host, that host will be used regardless of priority levels.
	//
	// When this mode is enabled, configurations that contain more than one host with the same metadata value for the single key in “keys“
	// will use only one of the hosts with the given key; no requests will be routed to the others. The cluster gauge
	// :ref:`lb_subsets_single_host_per_subset_duplicate<config_cluster_manager_cluster_stats_subset_lb>` indicates how many duplicates are
	// present in the current configuration.
	SingleHostPerSubset bool `protobuf:"varint,4,opt,name=single_host_per_subset,json=singleHostPerSubset,proto3" json:"single_host_per_subset,omitempty"`
	// The behavior used when no endpoint subset matches the selected route's
	// metadata.
	FallbackPolicy Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy `` /* 215-byte string literal not displayed */
	// Subset of
	// :ref:`keys<envoy_v3_api_field_extensions.load_balancing_policies.subset.v3.Subset.LbSubsetSelector.keys>` used by
	// :ref:`KEYS_SUBSET<envoy_v3_api_enum_value_extensions.load_balancing_policies.subset.v3.Subset.LbSubsetSelector.LbSubsetSelectorFallbackPolicy.KEYS_SUBSET>`
	// fallback policy.
	// It has to be a non empty list if KEYS_SUBSET fallback policy is selected.
	// For any other fallback policy the parameter is not used and should not be set.
	// Only values also present in
	// :ref:`keys<envoy_v3_api_field_extensions.load_balancing_policies.subset.v3.Subset.LbSubsetSelector.keys>` are allowed, but
	// “fallback_keys_subset“ cannot be equal to “keys“.
	FallbackKeysSubset []string `protobuf:"bytes,3,rep,name=fallback_keys_subset,json=fallbackKeysSubset,proto3" json:"fallback_keys_subset,omitempty"`
	// contains filtered or unexported fields
}

Specifications for subsets.

func (*Subset_LbSubsetSelector) Descriptor deprecated

func (*Subset_LbSubsetSelector) Descriptor() ([]byte, []int)

Deprecated: Use Subset_LbSubsetSelector.ProtoReflect.Descriptor instead.

func (*Subset_LbSubsetSelector) GetFallbackKeysSubset

func (x *Subset_LbSubsetSelector) GetFallbackKeysSubset() []string

func (*Subset_LbSubsetSelector) GetFallbackPolicy

func (*Subset_LbSubsetSelector) GetKeys

func (x *Subset_LbSubsetSelector) GetKeys() []string

func (*Subset_LbSubsetSelector) GetSingleHostPerSubset

func (x *Subset_LbSubsetSelector) GetSingleHostPerSubset() bool

func (*Subset_LbSubsetSelector) ProtoMessage

func (*Subset_LbSubsetSelector) ProtoMessage()

func (*Subset_LbSubsetSelector) ProtoReflect

func (x *Subset_LbSubsetSelector) ProtoReflect() protoreflect.Message

func (*Subset_LbSubsetSelector) Reset

func (x *Subset_LbSubsetSelector) Reset()

func (*Subset_LbSubsetSelector) String

func (x *Subset_LbSubsetSelector) String() string

func (*Subset_LbSubsetSelector) Validate

func (m *Subset_LbSubsetSelector) Validate() error

Validate checks the field values on Subset_LbSubsetSelector with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Subset_LbSubsetSelector) ValidateAll

func (m *Subset_LbSubsetSelector) ValidateAll() error

ValidateAll checks the field values on Subset_LbSubsetSelector with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in Subset_LbSubsetSelectorMultiError, or nil if none found.

type Subset_LbSubsetSelectorMultiError

type Subset_LbSubsetSelectorMultiError []error

Subset_LbSubsetSelectorMultiError is an error wrapping multiple validation errors returned by Subset_LbSubsetSelector.ValidateAll() if the designated constraints aren't met.

func (Subset_LbSubsetSelectorMultiError) AllErrors

func (m Subset_LbSubsetSelectorMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (Subset_LbSubsetSelectorMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type Subset_LbSubsetSelectorValidationError

type Subset_LbSubsetSelectorValidationError struct {
	// contains filtered or unexported fields
}

Subset_LbSubsetSelectorValidationError is the validation error returned by Subset_LbSubsetSelector.Validate if the designated constraints aren't met.

func (Subset_LbSubsetSelectorValidationError) Cause

Cause function returns cause value.

func (Subset_LbSubsetSelectorValidationError) Error

Error satisfies the builtin error interface

func (Subset_LbSubsetSelectorValidationError) ErrorName

ErrorName returns error name.

func (Subset_LbSubsetSelectorValidationError) Field

Field function returns field value.

func (Subset_LbSubsetSelectorValidationError) Key

Key function returns key value.

func (Subset_LbSubsetSelectorValidationError) Reason

Reason function returns reason value.

type Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy

type Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy int32

Allows to override top level fallback policy per selector.

const (
	// If NOT_DEFINED top level config fallback policy is used instead.
	Subset_LbSubsetSelector_NOT_DEFINED Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy = 0
	// If NO_FALLBACK is selected, a result equivalent to no healthy hosts is reported.
	Subset_LbSubsetSelector_NO_FALLBACK Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy = 1
	// If ANY_ENDPOINT is selected, any cluster endpoint may be returned
	// (subject to policy, health checks, etc).
	Subset_LbSubsetSelector_ANY_ENDPOINT Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy = 2
	// If DEFAULT_SUBSET is selected, load balancing is performed over the
	// endpoints matching the values from the default_subset field.
	Subset_LbSubsetSelector_DEFAULT_SUBSET Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy = 3
	// If KEYS_SUBSET is selected, subset selector matching is performed again with metadata
	// keys reduced to
	// :ref:`fallback_keys_subset<envoy_v3_api_field_extensions.load_balancing_policies.subset.v3.Subset.LbSubsetSelector.fallback_keys_subset>`.
	// It allows for a fallback to a different, less specific selector if some of the keys of
	// the selector are considered optional.
	Subset_LbSubsetSelector_KEYS_SUBSET Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy = 4
)

func (Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy) Descriptor

func (Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy) Enum

func (Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy) EnumDescriptor deprecated

Deprecated: Use Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy.Descriptor instead.

func (Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy) Number

func (Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy) String

func (Subset_LbSubsetSelector_LbSubsetSelectorFallbackPolicy) Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL