diff --git a/docs/BUILD b/docs/BUILD index 54a7b87e..7f0a1de7 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -55,6 +55,7 @@ proto_library( "//envoy/config/metrics/v2:stats", "//envoy/config/ratelimit/v2:rls", "//envoy/config/rbac/v2alpha:rbac", + "//envoy/config/resource_monitor/fixed_heap/v2alpha:fixed_heap", "//envoy/config/trace/v2:trace", "//envoy/config/transport_socket/capture/v2alpha:capture", "//envoy/data/accesslog/v2:accesslog", diff --git a/envoy/config/bootstrap/v2/BUILD b/envoy/config/bootstrap/v2/BUILD index 4024b11a..88f1e451 100644 --- a/envoy/config/bootstrap/v2/BUILD +++ b/envoy/config/bootstrap/v2/BUILD @@ -15,6 +15,7 @@ api_proto_library_internal( "//envoy/api/v2/core:config_source", "//envoy/config/metrics/v2:metrics_service", "//envoy/config/metrics/v2:stats", + "//envoy/config/overload/v2alpha:overload", "//envoy/config/ratelimit/v2:rls", "//envoy/config/trace/v2:trace", ], @@ -32,6 +33,7 @@ api_go_proto_library( "//envoy/api/v2/core:config_source_go_proto", "//envoy/config/metrics/v2:metrics_service_go_proto", "//envoy/config/metrics/v2:stats_go_proto", + "//envoy/config/overload/v2alpha:overload_go_proto", "//envoy/config/ratelimit/v2:rls_go_grpc", "//envoy/config/trace/v2:trace_go_proto", ], diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index 0dd3f419..e987aeab 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -16,6 +16,7 @@ import "envoy/api/v2/cds.proto"; import "envoy/api/v2/lds.proto"; import "envoy/config/trace/v2/trace.proto"; import "envoy/config/metrics/v2/stats.proto"; +import "envoy/config/overload/v2alpha/overload.proto"; import "envoy/config/ratelimit/v2/rls.proto"; import "google/protobuf/duration.proto"; @@ -123,6 +124,9 @@ message Bootstrap { // Configuration for the local administration HTTP server. Admin admin = 12 [(validate.rules).message.required = true, (gogoproto.nullable) = false]; + + // Optional overload manager configuration. + envoy.config.overload.v2alpha.OverloadManager overload_manager = 15; } // Administration interface :ref:`operations documentation diff --git a/envoy/config/overload/v2alpha/BUILD b/envoy/config/overload/v2alpha/BUILD index ef06407f..100b93df 100644 --- a/envoy/config/overload/v2alpha/BUILD +++ b/envoy/config/overload/v2alpha/BUILD @@ -1,8 +1,14 @@ -load("//bazel:api_build_system.bzl", "api_proto_library_internal") +load("//bazel:api_build_system.bzl", "api_go_proto_library", "api_proto_library_internal") licenses(["notice"]) # Apache 2 api_proto_library_internal( name = "overload", srcs = ["overload.proto"], + visibility = ["//visibility:public"], +) + +api_go_proto_library( + name = "overload", + proto = ":overload", ) diff --git a/envoy/config/overload/v2alpha/overload.proto b/envoy/config/overload/v2alpha/overload.proto index 6b70d11d..2b4f53f1 100644 --- a/envoy/config/overload/v2alpha/overload.proto +++ b/envoy/config/overload/v2alpha/overload.proto @@ -8,15 +8,19 @@ import "google/protobuf/struct.proto"; import "validate/validate.proto"; -// The Overload Manager provides an extensible framework to protect Envoy instances -// from overload of various resources (memory, cpu, file descriptors, etc) +// [#protodoc-title: Overload Manager] -message EmptyConfig { -} +// The Overload Manager provides an extensible framework to protect Envoy instances +// from overload of various resources (memory, cpu, file descriptors, etc). +// It monitors a configurable set of resources and notifies registered listeners +// when triggers related to those resources fire. message ResourceMonitor { // The name of the resource monitor to instantiate. Must match a registered - // resource monitor type. + // resource monitor type. The built-in resource monitors are: + // + // * :ref:`envoy.resource_monitors.fixed_heap + // ` string name = 1 [(validate.rules).string.min_bytes = 1]; // Configuration for the resource monitor being instantiated. @@ -45,7 +49,7 @@ message OverloadAction { // DNS to ensure uniqueness. string name = 1 [(validate.rules).string.min_bytes = 1]; - // A set of triggers for this action. If any of these triggers fires the overload action + // A set of triggers for this action. If any of these triggers fire the overload action // is activated. Listeners are notified when the overload action transitions from // inactivated to activated, or vice versa. repeated Trigger triggers = 2 [(validate.rules).repeated .min_items = 1]; @@ -59,5 +63,5 @@ message OverloadManager { repeated ResourceMonitor resource_monitors = 2 [(validate.rules).repeated .min_items = 1]; // The set of overload actions. - repeated OverloadAction actions = 3 [(validate.rules).repeated .min_items = 1]; + repeated OverloadAction actions = 3; } diff --git a/envoy/config/resource_monitor/fixed_heap/v2alpha/BUILD b/envoy/config/resource_monitor/fixed_heap/v2alpha/BUILD index adc77e5b..a69da8c4 100644 --- a/envoy/config/resource_monitor/fixed_heap/v2alpha/BUILD +++ b/envoy/config/resource_monitor/fixed_heap/v2alpha/BUILD @@ -5,4 +5,5 @@ licenses(["notice"]) # Apache 2 api_proto_library_internal( name = "fixed_heap", srcs = ["fixed_heap.proto"], + visibility = ["//visibility:public"], ) diff --git a/envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.proto b/envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.proto index 08e3c653..6e0127a5 100644 --- a/envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.proto +++ b/envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.proto @@ -3,8 +3,11 @@ syntax = "proto3"; package envoy.config.resource_monitor.fixed_heap.v2alpha; option go_package = "v2alpha"; +// [#protodoc-title: Fixed heap] + +// The fixed heap resource monitor reports the Envoy process memory pressure, computed as a +// fraction of currently reserved heap memory divided by a statically configured maximum +// specified in the FixedHeapConfig. message FixedHeapConfig { - // Limit of the Envoy process heap size. This is used to calculate heap memory pressure which - // is defined as (current heap size)/max_heap_size_bytes. uint64 max_heap_size_bytes = 1; }