From d46c08ce371518e3c6e8147a78d744cf85d9d00b Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 06:16:56 +0000 Subject: [PATCH] generic proxy: new kafka codec support (#31407) * initial commit Signed-off-by: wbpcode * add more test Signed-off-by: wbpcode * complete test Signed-off-by: wbpcode * Kick CI Signed-off-by: wbpcode --------- Signed-off-by: wbpcode Mirrored from https://github.com/envoyproxy/envoy @ b039d8a316a081d1eae3e3222e045b749d26765e --- BUILD | 1 + .../generic_proxy/codecs/kafka/v3/BUILD | 12 +++++++ .../generic_proxy/codecs/kafka/v3/kafka.proto | 35 +++++++++++++++++++ versioning/BUILD | 1 + 4 files changed, 49 insertions(+) create mode 100644 contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3/BUILD create mode 100644 contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3/kafka.proto diff --git a/BUILD b/BUILD index 20324443..e9eb8cd0 100644 --- a/BUILD +++ b/BUILD @@ -82,6 +82,7 @@ proto_library( "//contrib/envoy/extensions/filters/network/client_ssl_auth/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/action/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/codecs/dubbo/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/router/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/v3:pkg", diff --git a/contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3/BUILD b/contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3/BUILD new file mode 100644 index 00000000..d49202b7 --- /dev/null +++ b/contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/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 = [ + "@com_github_cncf_xds//udpa/annotations:pkg", + "@com_github_cncf_xds//xds/annotations/v3:pkg", + ], +) diff --git a/contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3/kafka.proto b/contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3/kafka.proto new file mode 100644 index 00000000..0e6998f8 --- /dev/null +++ b/contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3/kafka.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.generic_proxy.codecs.kafka.v3; + +import "xds/annotations/v3/status.proto"; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.generic_proxy.codecs.kafka.v3"; +option java_outer_classname = "KafkaProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3;kafkav3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; +option (xds.annotations.v3.file_status).work_in_progress = true; + +// [#protodoc-title: Kafka codec configuration for Generic Proxy] +// [#extension: envoy.generic_proxy.codecs.kafka] + +// Configuration for Kafka codec. This codec gives the generic proxy the ability to proxy +// Kafka traffic. But note any route configuration for Kafka traffic is not supported yet. +// The generic proxy can only used to generate logs or metrics for Kafka traffic but cannot +// do matching or routing. +// +// .. note:: +// The codec can currently only be used in the sidecar mode. And to ensure the codec works +// properly, please make sure the following conditions are met: +// +// 1. The generic proxy must be configured with a wildcard route that matches all traffic. +// 2. The target cluster must be configured as a original destination cluster. +// 3. The :ref:`bind_upstream_connection +// ` +// of generic proxy router must be set to true to ensure same upstream connection is used +// for all traffic from same downstream connection. +message KafkaCodecConfig { +} diff --git a/versioning/BUILD b/versioning/BUILD index 9f50e26d..828efeaa 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -20,6 +20,7 @@ proto_library( "//contrib/envoy/extensions/filters/network/client_ssl_auth/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/action/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/codecs/dubbo/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/codecs/kafka/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/router/v3:pkg", "//contrib/envoy/extensions/filters/network/generic_proxy/v3:pkg",