hds: add support for cluster transport_socket_matches. (#12905)

In order to support TLS in a health check connection, a TransportSocket proto must be matched to build the proper TLS connection factory. These are matched by the repeated field transport_socket_matches in the cluster proto, which HDS is currently leaving blank when building this proto. As a result, there is not way to specify a TLS transport socket or any transport socket listed in the docs.

This change adds the transport_socket_matches field to the HDS health check specifier, and adds it to the Cluster config generated by HDS, to support transport socket matches per-health check.

Risk Level: Low
Testing: HDS Unit tests and integration tests pass. Added unit test to test that the transport socket matcher receives the correct fields. Added two integration tests with a TLS configuration, one over HTTP and one over HTTP/2.
Docs Changes: Added comments about the new transport_socket_maches field in the HDS specifier proto.
Release Notes: Included

Signed-off-by: Drew S. Ortega <drewortega@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ bf6b9ba65495175e164b4ef0051b94cd66e7dbf5
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent f424d4aad1
commit 2bb47b2b6f
  1. 1
      envoy/service/health/v3/BUILD
  2. 6
      envoy/service/health/v3/hds.proto
  3. 1
      envoy/service/health/v4alpha/BUILD
  4. 6
      envoy/service/health/v4alpha/hds.proto

@ -7,6 +7,7 @@ licenses(["notice"]) # Apache 2
api_proto_package(
has_services = True,
deps = [
"//envoy/config/cluster/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/endpoint/v3:pkg",
"//envoy/service/discovery/v2:pkg",

@ -2,6 +2,7 @@ syntax = "proto3";
package envoy.service.health.v3;
import "envoy/config/cluster/v3/cluster.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/health_check.proto";
import "envoy/config/endpoint/v3/endpoint_components.proto";
@ -168,6 +169,11 @@ message ClusterHealthCheck {
repeated config.core.v3.HealthCheck health_checks = 2;
repeated LocalityEndpoints locality_endpoints = 3;
// Optional map that gets filtered by :ref:`health_checks.transport_socket_match_criteria <envoy_api_field_config.core.v3.HealthCheck.transport_socket_match_criteria>`
// on connection when health checking. For more details, see
// :ref:`config.cluster.v3.Cluster.transport_socket_matches <envoy_api_field_config.cluster.v3.Cluster.transport_socket_matches>`.
repeated config.cluster.v3.Cluster.TransportSocketMatch transport_socket_matches = 4;
}
message HealthCheckSpecifier {

@ -7,6 +7,7 @@ licenses(["notice"]) # Apache 2
api_proto_package(
has_services = True,
deps = [
"//envoy/config/cluster/v4alpha:pkg",
"//envoy/config/core/v4alpha:pkg",
"//envoy/config/endpoint/v3:pkg",
"//envoy/service/health/v3:pkg",

@ -2,6 +2,7 @@ syntax = "proto3";
package envoy.service.health.v4alpha;
import "envoy/config/cluster/v4alpha/cluster.proto";
import "envoy/config/core/v4alpha/base.proto";
import "envoy/config/core/v4alpha/health_check.proto";
import "envoy/config/endpoint/v3/endpoint_components.proto";
@ -173,6 +174,11 @@ message ClusterHealthCheck {
repeated config.core.v4alpha.HealthCheck health_checks = 2;
repeated LocalityEndpoints locality_endpoints = 3;
// Optional map that gets filtered by :ref:`health_checks.transport_socket_match_criteria <envoy_api_field_config.core.v4alpha.HealthCheck.transport_socket_match_criteria>`
// on connection when health checking. For more details, see
// :ref:`config.cluster.v3.Cluster.transport_socket_matches <envoy_api_field_config.cluster.v4alpha.Cluster.transport_socket_matches>`.
repeated config.cluster.v4alpha.Cluster.TransportSocketMatch transport_socket_matches = 4;
}
message HealthCheckSpecifier {

Loading…
Cancel
Save