api: add bootstrap extensions (#11413)

Commit Message:
Adds a configurable server wide extension hook point. Allow extensions to instantiate singletons / context managers with configs in bootstrap.

Additional Description:
Risk Level: Low (not used API)
Testing: unittest, mock
Docs Changes: protodoc
Release Notes: N/A as no real extension lives today.
Fixes #11219
Signed-off-by: Lizan Zhou <lizan@tetrate.io>

Mirrored from https://github.com/envoyproxy/envoy @ 8cb2958f29af3e45e87653356b6099bd3a4cbfbf
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 7807dfe95f
commit 365d254b96
  1. 7
      envoy/config/bootstrap/v3/bootstrap.proto
  2. 7
      envoy/config/bootstrap/v4alpha/bootstrap.proto

@ -7,6 +7,7 @@ import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto"; import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto"; import "envoy/config/core/v3/config_source.proto";
import "envoy/config/core/v3/event_service_config.proto"; import "envoy/config/core/v3/event_service_config.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/socket_option.proto"; import "envoy/config/core/v3/socket_option.proto";
import "envoy/config/listener/v3/listener.proto"; import "envoy/config/listener/v3/listener.proto";
import "envoy/config/metrics/v3/stats.proto"; import "envoy/config/metrics/v3/stats.proto";
@ -35,7 +36,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// <config_overview_bootstrap>` for more detail. // <config_overview_bootstrap>` for more detail.
// Bootstrap :ref:`configuration overview <config_overview_bootstrap>`. // Bootstrap :ref:`configuration overview <config_overview_bootstrap>`.
// [#next-free-field: 21] // [#next-free-field: 22]
message Bootstrap { message Bootstrap {
option (udpa.annotations.versioning).previous_message_type = option (udpa.annotations.versioning).previous_message_type =
"envoy.config.bootstrap.v2.Bootstrap"; "envoy.config.bootstrap.v2.Bootstrap";
@ -181,6 +182,10 @@ message Bootstrap {
// :ref:`use_tcp_for_dns_lookups <envoy_api_field_config.cluster.v3.Cluster.use_tcp_for_dns_lookups>` are // :ref:`use_tcp_for_dns_lookups <envoy_api_field_config.cluster.v3.Cluster.use_tcp_for_dns_lookups>` are
// specified. // specified.
bool use_tcp_for_dns_lookups = 20; bool use_tcp_for_dns_lookups = 20;
// Specifies optional bootstrap extensions to be instantiated at startup time.
// Each item contains extension specific configuration.
repeated core.v3.TypedExtensionConfig bootstrap_extensions = 21;
} }
// Administration interface :ref:`operations documentation // Administration interface :ref:`operations documentation

@ -7,6 +7,7 @@ import "envoy/config/core/v4alpha/address.proto";
import "envoy/config/core/v4alpha/base.proto"; import "envoy/config/core/v4alpha/base.proto";
import "envoy/config/core/v4alpha/config_source.proto"; import "envoy/config/core/v4alpha/config_source.proto";
import "envoy/config/core/v4alpha/event_service_config.proto"; import "envoy/config/core/v4alpha/event_service_config.proto";
import "envoy/config/core/v4alpha/extension.proto";
import "envoy/config/core/v4alpha/socket_option.proto"; import "envoy/config/core/v4alpha/socket_option.proto";
import "envoy/config/listener/v4alpha/listener.proto"; import "envoy/config/listener/v4alpha/listener.proto";
import "envoy/config/metrics/v4alpha/stats.proto"; import "envoy/config/metrics/v4alpha/stats.proto";
@ -34,7 +35,7 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO
// <config_overview_bootstrap>` for more detail. // <config_overview_bootstrap>` for more detail.
// Bootstrap :ref:`configuration overview <config_overview_bootstrap>`. // Bootstrap :ref:`configuration overview <config_overview_bootstrap>`.
// [#next-free-field: 21] // [#next-free-field: 22]
message Bootstrap { message Bootstrap {
option (udpa.annotations.versioning).previous_message_type = option (udpa.annotations.versioning).previous_message_type =
"envoy.config.bootstrap.v3.Bootstrap"; "envoy.config.bootstrap.v3.Bootstrap";
@ -173,6 +174,10 @@ message Bootstrap {
// :ref:`use_tcp_for_dns_lookups <envoy_api_field_config.cluster.v4alpha.Cluster.use_tcp_for_dns_lookups>` are // :ref:`use_tcp_for_dns_lookups <envoy_api_field_config.cluster.v4alpha.Cluster.use_tcp_for_dns_lookups>` are
// specified. // specified.
bool use_tcp_for_dns_lookups = 20; bool use_tcp_for_dns_lookups = 20;
// Specifies optional bootstrap extensions to be instantiated at startup time.
// Each item contains extension specific configuration.
repeated core.v4alpha.TypedExtensionConfig bootstrap_extensions = 21;
} }
// Administration interface :ref:`operations documentation // Administration interface :ref:`operations documentation

Loading…
Cancel
Save