Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes for refactoring Envoy DNS resolution as first class extension #17272

Merged
merged 12 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion api/envoy/config/bootstrap/v3/bootstrap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// <config_overview_bootstrap>` for more detail.

// Bootstrap :ref:`configuration overview <config_overview_bootstrap>`.
// [#next-free-field: 31]
// [#next-free-field: 32]
message Bootstrap {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.bootstrap.v2.Bootstrap";
Expand Down Expand Up @@ -260,8 +260,24 @@ message Bootstrap {
// This may be overridden on a per-cluster basis in cds_config, when
// :ref:`dns_resolution_config <envoy_v3_api_field_config.cluster.v3.Cluster.dns_resolution_config>`
// is specified.
// *dns_resolution_config* will be deprecated once
// :ref:'typed_dns_resolver_config <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.typed_dns_resolver_config>'
// is fully supported.
core.v3.DnsResolutionConfig dns_resolution_config = 30;

// DNS resolver type configuration extension. This extension can be used to configure c-ares, apple,
// or any other DNS resolver types and the related parameters. When c-ares DNS is configured,
// :ref:'dns_resolution_config <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.dns_resolution_config>'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be <envoy_api_field_core.DnsResultionConfig> instead of <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.dns_resolution_config>

The same issue is in the other proto files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's right. Thanks!

I did some research and found the complete syntax is: :ref:DnsResolutionConfig <envoy_v3_api_msg_config.core.v3.DnsResolutionConfig> and made the change.

Please let me know whether this look good.

// will be enclosed in this *typed_dns_resolver_config*.
// This configuration is to replace the *dns_resolution_config* configuration eventually.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/is to/will/

Express this as a TODO and/or an issue to track it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

// During the transition period when both *dns_resolution_config* and *typed_dns_resolver_config* exists,
// this configuration is optional.
// When *typed_dns_resolver_config* is in place, Envoy will use it and ignore *dns_resolution_config*.
// When *typed_dns_resolver_config* is missing, the default behavior is in place. Envoy will either use
// c-ares DNS library or apple DNS library based on the compiling flag.
htuch marked this conversation as resolved.
Show resolved Hide resolved
// [#not-implemented-hide:]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also track the addition of a null DNS configuration mode, where no DNS library is compiled in, and DNS resolutions all fail gracefully?

Copy link
Contributor Author

@yanjunxiang-google yanjunxiang-google Jul 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can support the NULL DNS configuration mode if the new typed_dns_resolver_config configuration is in place, and check it and have DNS resolutions fail gracefully.

However, in the case if this configuration is missing, IIUC there is no information for us to identify NULL DNS configuration mode, then, the existing logic (#ifdef) will be executed.

BTW, to make this change backward compatible, this new typed configuration is an optional field for now.

core.v3.TypedExtensionConfig typed_dns_resolver_config = 31;

// Specifies optional bootstrap extensions to be instantiated at startup time.
// Each item contains extension specific configuration.
// [#extension-category: envoy.bootstrap]
Expand Down
18 changes: 17 additions & 1 deletion api/envoy/config/bootstrap/v4alpha/bootstrap.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ message ClusterCollection {
}

// Configuration for a single upstream cluster.
// [#next-free-field: 55]
// [#next-free-field: 56]
message Cluster {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.Cluster";

Expand Down Expand Up @@ -874,8 +874,24 @@ message Cluster {
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];

// DNS resolution configuration which includes the underlying dns resolver addresses and options.
// *dns_resolution_config* will be deprecated once
// :ref:'typed_dns_resolver_config <envoy_v3_api_field_config.cluster.v3.Cluster.typed_dns_resolver_config>'
// is fully supported.
core.v3.DnsResolutionConfig dns_resolution_config = 53;

// DNS resolver type configuration extension. This extension can be used to configure c-ares, apple,
// or any other DNS resolver types and the related parameters. When c-ares DNS is configured,
// :ref:'dns_resolution_config <envoy_v3_api_field_config.cluster.v3.Cluster.dns_resolution_config>'
// will be enclosed in this *typed_dns_resolver_config*.
// This configuration is to replace the *dns_resolution_config* configuration eventually.
// During the transition period when both *dns_resolution_config* and *typed_dns_resolver_config* exists,
// this configuration is optional.
// When *typed_dns_resolver_config* is in place, Envoy will use it and ignore *dns_resolution_config*.
// When *typed_dns_resolver_config* is missing, the default behavior is in place. Envoy will either use
// c-ares DNS library or apple DNS library based on the compiling flag.
// [#not-implemented-hide:]
core.v3.TypedExtensionConfig typed_dns_resolver_config = 55;

// Optional configuration for having cluster readiness block on warm-up. Currently, only applicable for
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`,
// or :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`.
Expand Down
18 changes: 17 additions & 1 deletion api/envoy/config/cluster/v4alpha/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package envoy.extensions.common.dynamic_forward_proxy.v3;

import "envoy/config/cluster/v3/cluster.proto";
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/resolver.proto";

import "google/protobuf/duration.proto";
Expand All @@ -30,7 +31,7 @@ message DnsCacheCircuitBreakers {

// Configuration for the dynamic forward proxy DNS cache. See the :ref:`architecture overview
// <arch_overview_http_dynamic_forward_proxy>` for more information.
// [#next-free-field: 12]
// [#next-free-field: 13]
message DnsCacheConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.common.dynamic_forward_proxy.v2alpha.DnsCacheConfig";
Expand Down Expand Up @@ -108,8 +109,24 @@ message DnsCacheConfig {
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];

// DNS resolution configuration which includes the underlying dns resolver addresses and options.
// *dns_resolution_config* will be deprecated once
// :ref:'typed_dns_resolver_config <envoy_v3_api_field_extensions.common.dynamic_forward_proxy.v3.DnsCacheConfig.typed_dns_resolver_config>'
// is fully supported.
config.core.v3.DnsResolutionConfig dns_resolution_config = 9;

// DNS resolver type configuration extension. This extension can be used to configure c-ares, apple,
// or any other DNS resolver types and the related parameters. When c-ares DNS is configured,
// :ref:'dns_resolution_config <envoy_v3_api_field_extensions.common.dynamic_forward_proxy.v3.DnsCacheConfig.dns_resolution_config>'
// will be enclosed in this *typed_dns_resolver_config*.
// This configuration is to replace the *dns_resolution_config* configuration eventually.
// During the transition period when both *dns_resolution_config* and *typed_dns_resolver_config* exists,
// this configuration is optional.
// When *typed_dns_resolver_config* is in place, Envoy will use it and ignore *dns_resolution_config*.
// When *typed_dns_resolver_config* is missing, the default behavior is in place. Envoy will either use
// c-ares DNS library or apple DNS library based on the compiling flag.
// [#not-implemented-hide:]
config.core.v3.TypedExtensionConfig typed_dns_resolver_config = 12;

// Hostnames that should be preresolved into the cache upon creation. This might provide a
// performance improvement, in the form of cache hits, for hostnames that are going to be
// resolved during steady state and are known at config load time.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion generated_api_shadow/envoy/config/cluster/v3/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading