From 69d44c929d75c078a2a1d511de749940f4e241ae Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Wed, 28 Sep 2022 14:47:31 +0000 Subject: [PATCH] xds: Add a KeyValueStore-backed xDS delegate extension to contrib (#22921) An xDS delegate extension point was added in #22473 to enable custom behavior upon receiving and loading xDS resources. This change creates an implementation of the XdsResourcesDelegate interface that is backed by a KeyValueStore. The intended use case is to enable persisting xDS resources and loading them on startup in Envoy Mobile, in the event that the xDS control plane is unreachable. Signed-off-by: Ali Beyad abeyad@google.com Risk Level: Low Testing: Unit & Integration tests Docs Changes: N/A (hidden experimental feature) Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Ali Beyad Mirrored from https://github.com/envoyproxy/envoy @ f28db324be3fcb6e91eb5a89d90c08617f76a2b2 --- contrib/envoy/extensions/config/v3alpha/BUILD | 12 ++++++++ .../kv_store_xds_delegate_config.proto | 29 +++++++++++++++++++ versioning/BUILD | 1 + 3 files changed, 42 insertions(+) create mode 100644 contrib/envoy/extensions/config/v3alpha/BUILD create mode 100644 contrib/envoy/extensions/config/v3alpha/kv_store_xds_delegate_config.proto diff --git a/contrib/envoy/extensions/config/v3alpha/BUILD b/contrib/envoy/extensions/config/v3alpha/BUILD new file mode 100644 index 00000000..cfd406e0 --- /dev/null +++ b/contrib/envoy/extensions/config/v3alpha/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/config/common/key_value/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/contrib/envoy/extensions/config/v3alpha/kv_store_xds_delegate_config.proto b/contrib/envoy/extensions/config/v3alpha/kv_store_xds_delegate_config.proto new file mode 100644 index 00000000..63926424 --- /dev/null +++ b/contrib/envoy/extensions/config/v3alpha/kv_store_xds_delegate_config.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package envoy.extensions.config.v3alpha; + +import "envoy/config/common/key_value/v3/config.proto"; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.config.v3alpha"; +option java_outer_classname = "KvStoreXdsDelegateConfigProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/config/v3alpha"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#extension: envoy.xds_delegates.kv_store] +// +// Configuration for a KeyValueStore-based XdsResourcesDelegate implementation. This implementation +// updates the underlying KV store with xDS resources received from the configured management +// servers, enabling configuration to be persisted locally and used on startup in case connectivity +// with the xDS management servers could not be established. +// +// The KV Store based delegate's handling of wildcard resources (empty resource list or "*") is +// designed for use with O(100) resources or fewer, so it's not currently advised to use this +// feature for large configurations with heavy use of wildcard resources. +message KeyValueStoreXdsDelegateConfig { + // Configuration for the KeyValueStore that holds the xDS resources. + // [#allow-fully-qualified-name:] + .envoy.config.common.key_value.v3.KeyValueStoreConfig key_value_store_config = 1; +} diff --git a/versioning/BUILD b/versioning/BUILD index e8817753..cac08b19 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -9,6 +9,7 @@ proto_library( name = "active_protos", visibility = ["//visibility:public"], deps = [ + "//contrib/envoy/extensions/config/v3alpha:pkg", "//contrib/envoy/extensions/filters/http/dynamo/v3:pkg", "//contrib/envoy/extensions/filters/http/language/v3alpha:pkg", "//contrib/envoy/extensions/filters/http/squash/v3:pkg",