retry host predicate: add new predicate to omit hosts based on endpoint metadata match (#9563)
Currently supported retry host predicates only allow omitting either previously tried or canary hosts. This enhancement is to add a new host predicate that looks at the endpoint metadata match and omits the host in case of a match with the host metadata. See #9531 Risk Level: Low Testing: Unit testing Docs Changes: Added new proto for omit_hosts Signed-off-by: Prakhar Gautam <prakhag@gmail.com> Mirrored from https://github.com/envoyproxy/envoy @ e2fdf70f0fca0f9a9a66046fd80b280981b3f0edmaster-ci-test
parent
699e836a48
commit
4829d33ce4
6 changed files with 81 additions and 0 deletions
@ -0,0 +1,12 @@ |
|||||||
|
# DO NOT EDIT. This file is generated by tools/proto_sync.py. |
||||||
|
|
||||||
|
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") |
||||||
|
|
||||||
|
licenses(["notice"]) # Apache 2 |
||||||
|
|
||||||
|
api_proto_package( |
||||||
|
deps = [ |
||||||
|
"//envoy/api/v2/core:pkg", |
||||||
|
"@com_github_cncf_udpa//udpa/annotations:pkg", |
||||||
|
], |
||||||
|
) |
@ -0,0 +1,26 @@ |
|||||||
|
syntax = "proto3"; |
||||||
|
|
||||||
|
package envoy.config.retry.omit_host_metadata.v2; |
||||||
|
|
||||||
|
import "envoy/api/v2/core/base.proto"; |
||||||
|
|
||||||
|
import "udpa/annotations/migrate.proto"; |
||||||
|
|
||||||
|
option java_package = "io.envoyproxy.envoy.config.retry.omit_host_metadata.v2"; |
||||||
|
option java_outer_classname = "OmitHostMetadataConfigProto"; |
||||||
|
option java_multiple_files = true; |
||||||
|
option (udpa.annotations.file_migrate).move_to_package = |
||||||
|
"envoy.extensions.retry.host.omit_host_metadata.v3"; |
||||||
|
|
||||||
|
// [#protodoc-title: Omit host metadata retry predicate] |
||||||
|
|
||||||
|
// A retry host predicate that can be used to reject a host based on |
||||||
|
// predefined metadata match criteria. |
||||||
|
// [#extension: envoy.retry_host_predicates.omit_host_metadata] |
||||||
|
message OmitHostMetadataConfig { |
||||||
|
// Retry host predicate metadata match criteria. The hosts in |
||||||
|
// the upstream cluster with matching metadata will be omitted while |
||||||
|
// attempting a retry of a failed request. The metadata should be specified |
||||||
|
// under the *envoy.lb* key. |
||||||
|
api.v2.core.Metadata metadata_match = 1; |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
# DO NOT EDIT. This file is generated by tools/proto_sync.py. |
||||||
|
|
||||||
|
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") |
||||||
|
|
||||||
|
licenses(["notice"]) # Apache 2 |
||||||
|
|
||||||
|
api_proto_package( |
||||||
|
deps = [ |
||||||
|
"//envoy/config/core/v3:pkg", |
||||||
|
"//envoy/config/retry/omit_host_metadata/v2:pkg", |
||||||
|
"@com_github_cncf_udpa//udpa/annotations:pkg", |
||||||
|
], |
||||||
|
) |
@ -0,0 +1,27 @@ |
|||||||
|
syntax = "proto3"; |
||||||
|
|
||||||
|
package envoy.extensions.retry.host.omit_host_metadata.v3; |
||||||
|
|
||||||
|
import "envoy/config/core/v3/base.proto"; |
||||||
|
|
||||||
|
import "udpa/annotations/versioning.proto"; |
||||||
|
|
||||||
|
option java_package = "io.envoyproxy.envoy.extensions.retry.host.omit_host_metadata.v3"; |
||||||
|
option java_outer_classname = "OmitHostMetadataConfigProto"; |
||||||
|
option java_multiple_files = true; |
||||||
|
|
||||||
|
// [#protodoc-title: Omit host metadata retry predicate] |
||||||
|
|
||||||
|
// A retry host predicate that can be used to reject a host based on |
||||||
|
// predefined metadata match criteria. |
||||||
|
// [#extension: envoy.retry_host_predicates.omit_host_metadata] |
||||||
|
message OmitHostMetadataConfig { |
||||||
|
option (udpa.annotations.versioning).previous_message_type = |
||||||
|
"envoy.config.retry.omit_host_metadata.v2.OmitHostMetadataConfig"; |
||||||
|
|
||||||
|
// Retry host predicate metadata match criteria. The hosts in |
||||||
|
// the upstream cluster with matching metadata will be omitted while |
||||||
|
// attempting a retry of a failed request. The metadata should be specified |
||||||
|
// under the *envoy.lb* key. |
||||||
|
config.core.v3.Metadata metadata_match = 1; |
||||||
|
} |
Loading…
Reference in new issue