From 871c92f2b2aa5cdc44c4e39205b6ddffd2d30e77 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Fri, 30 Sep 2022 15:33:45 +0000 Subject: [PATCH] Thrift health checker support (#23043) Signed-off-by: kuochunghsu Mirrored from https://github.com/envoyproxy/envoy @ d079cb3b5cfc37f7f9c2d49e266c98d4a91b63e5 --- BUILD | 1 + envoy/data/core/v3/health_check_event.proto | 1 + .../health_checkers/thrift/v3/BUILD | 12 ++++++ .../health_checkers/thrift/v3/thrift.proto | 41 +++++++++++++++++++ versioning/BUILD | 1 + 5 files changed, 56 insertions(+) create mode 100644 envoy/extensions/health_checkers/thrift/v3/BUILD create mode 100644 envoy/extensions/health_checkers/thrift/v3/thrift.proto diff --git a/BUILD b/BUILD index 1d438047..48896d9d 100644 --- a/BUILD +++ b/BUILD @@ -225,6 +225,7 @@ proto_library( "//envoy/extensions/formatter/metadata/v3:pkg", "//envoy/extensions/formatter/req_without_query/v3:pkg", "//envoy/extensions/health_checkers/redis/v3:pkg", + "//envoy/extensions/health_checkers/thrift/v3:pkg", "//envoy/extensions/http/header_formatters/preserve_case/v3:pkg", "//envoy/extensions/http/header_validators/envoy_default/v3:pkg", "//envoy/extensions/http/original_ip_detection/custom_header/v3:pkg", diff --git a/envoy/data/core/v3/health_check_event.proto b/envoy/data/core/v3/health_check_event.proto index 63f7beb0..a349fa31 100644 --- a/envoy/data/core/v3/health_check_event.proto +++ b/envoy/data/core/v3/health_check_event.proto @@ -31,6 +31,7 @@ enum HealthCheckerType { TCP = 1; GRPC = 2; REDIS = 3; + THRIFT = 4; } // [#next-free-field: 10] diff --git a/envoy/extensions/health_checkers/thrift/v3/BUILD b/envoy/extensions/health_checkers/thrift/v3/BUILD new file mode 100644 index 00000000..8e325386 --- /dev/null +++ b/envoy/extensions/health_checkers/thrift/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/extensions/filters/network/thrift_proxy/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/envoy/extensions/health_checkers/thrift/v3/thrift.proto b/envoy/extensions/health_checkers/thrift/v3/thrift.proto new file mode 100644 index 00000000..c0297b17 --- /dev/null +++ b/envoy/extensions/health_checkers/thrift/v3/thrift.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package envoy.extensions.health_checkers.thrift.v3; + +import "envoy/extensions/filters/network/thrift_proxy/v3/thrift_proxy.proto"; + +import "udpa/annotations/status.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.health_checkers.thrift.v3"; +option java_outer_classname = "ThriftProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/health_checkers/thrift/v3;thriftv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Thrift] +// Thrift health checker :ref:`configuration overview `. +// [#extension: envoy.health_checkers.thrift] + +message Thrift { + // Specifies the method name that will be set on each health check request dispatched to an upstream host. + // Note that method name is case sensitive. + string method_name = 1 [(validate.rules).string = {min_len: 1}]; + + // Configures the transport type to be used with the health checks. Note that + // :ref:`AUTO_TRANSPORT` + // is not supported, and we don't honor :ref:`ThriftProtocolOptions` + // since it's possible to set to :ref:`AUTO_TRANSPORT`. + // [#extension-category: envoy.filters.network] + filters.network.thrift_proxy.v3.TransportType transport = 2 + [(validate.rules).enum = {defined_only: true}]; + + // Configures the protocol type to be used with the health checks. Note that + // :ref:`AUTO_PROTOCOL` + // and :ref:`TWITTER` + // are not supported, and we don't honor :ref:`ThriftProtocolOptions` + // since it's possible to set to :ref:`AUTO_PROTOCOL` + // or :ref:`TWITTER`. + filters.network.thrift_proxy.v3.ProtocolType protocol = 3 + [(validate.rules).enum = {defined_only: true}]; +} diff --git a/versioning/BUILD b/versioning/BUILD index cac08b19..475c4edd 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -165,6 +165,7 @@ proto_library( "//envoy/extensions/formatter/metadata/v3:pkg", "//envoy/extensions/formatter/req_without_query/v3:pkg", "//envoy/extensions/health_checkers/redis/v3:pkg", + "//envoy/extensions/health_checkers/thrift/v3:pkg", "//envoy/extensions/http/header_formatters/preserve_case/v3:pkg", "//envoy/extensions/http/header_validators/envoy_default/v3:pkg", "//envoy/extensions/http/original_ip_detection/custom_header/v3:pkg",