address: merge Resolved/Unresolved address types. (#146)

Since we may want to use a resolver plugin in most places, it doesn't
make sense to have this strong separation between the two in the API.

Also bonus renumbering cleanup in LDS.
pull/148/head
htuch 8 years ago committed by GitHub
parent fc3467906e
commit 202ec460a0
  1. 60
      api/address.proto
  2. 2
      api/base.proto
  3. 39
      api/cds.proto
  4. 20
      api/lds.proto

@ -10,10 +10,14 @@ message Pipe {
string path = 1; string path = 1;
} }
// Unresolved addresses contain either named hosts or ports that require // Addresses specify either a logical or physical address and port, which are
// resolution via DNS or an optional custom Resolver. // used to tell Envoy where to bind/listen, connect to upstream and find
message UnresolvedAddress { // management servers. They may optionally name a resolver that will be used at
message NamedAddress { // runtime for further transformation. Resolution may also be performed in a
// context dependent manner, e.g. when an Address is used for an upstream
// logical DNS host.
message Address {
message SocketAddress {
enum Protocol { enum Protocol {
TCP = 0; TCP = 0;
} }
@ -25,47 +29,19 @@ message UnresolvedAddress {
// DNS. // DNS.
string address = 2; string address = 2;
oneof port_specifier { oneof port_specifier {
google.protobuf.UInt32Value port = 3; uint32 port_value = 3;
string service_name = 4; // This is only valid if DNS SRV or if resolver_name is specified below
} // and the named resolver is capable of named port resolution.
string named_port = 4;
} }
// Support pluggable resolvers.
message Resolver {
// Name of the resolver. This must have been registered with Envoy.
string name = 1;
// TODO(htuch): Do we need further extensibility or should we collapse
// Resolver to a string?
} }
// If not specified, the default DNS resolver is used. // Name of the resolver. This must have been registered with Envoy. If this is
Resolver resolver = 1; // empty, a context dependent default applies. If the address is expected to
// be a hostname, it will be DNS resolution. If the address is expected to be
// a concrete IP address, no resolution will occur.
string resolver_name = 1;
oneof address { oneof address {
NamedAddress named_address = 2; SocketAddress named_address = 2;
Pipe pipe = 3; Pipe pipe = 3;
} }
} }
message UnresolvedAddresses {
repeated UnresolvedAddress addresses = 1;
}
// A ResolvedAddress identifies a concrete socket or UDS path and is not subject
// to further resolution via DNS or custom resolvers.
message ResolvedAddress {
message SocketAddress {
enum Protocol {
TCP = 0;
}
Protocol protocol = 1;
// IP address as returned by inet_ntop().
string ip_address = 2;
google.protobuf.UInt32Value port = 3;
}
oneof address {
SocketAddress socket_address = 2;
Pipe pipe = 3;
}
}
message ResolvedAddresses {
repeated ResolvedAddress addresses = 1;
}

@ -37,7 +37,7 @@ message Node {
} }
message Endpoint { message Endpoint {
ResolvedAddress address = 1; Address address = 1;
} }
// Metadata provides additional inputs to filters based on matched listeners, // Metadata provides additional inputs to filters based on matched listeners,

@ -31,7 +31,7 @@ service ClusterDiscoveryService {
// connections. // connections.
message UpstreamBindConfig { message UpstreamBindConfig {
// The address Envoy should bind to when establishing upstream connections. // The address Envoy should bind to when establishing upstream connections.
ResolvedAddress source_address = 1; Address source_address = 1;
} }
// Circuit breaking settings can be specified individually for each defined // Circuit breaking settings can be specified individually for each defined
@ -101,42 +101,39 @@ message Cluster {
} }
LbPolicy lb_policy = 6; LbPolicy lb_policy = 6;
// If the service discovery type is static, static_hosts is required. If the // If the service discovery type is static, strict_dns or logical_dns, then
// service discovery type is strict_dns or logical_dns, dns_hosts is required. // hosts is required.
oneof hosts_specifier { repeated Address hosts = 7;
ResolvedAddresses static_hosts = 7;
UnresolvedAddresses dns_hosts = 8;
}
// Optional active health checking configuration for the cluster. If no // Optional active health checking configuration for the cluster. If no
// configuration is specified no health checking will be done and all cluster // configuration is specified no health checking will be done and all cluster
// members will be considered healthy at all times. // members will be considered healthy at all times.
repeated HealthCheck health_checks = 9; repeated HealthCheck health_checks = 8;
// Optional maximum requests for a single upstream connection. This parameter // Optional maximum requests for a single upstream connection. This parameter
// is respected by both the HTTP/1.1 and HTTP/2 connection pool // is respected by both the HTTP/1.1 and HTTP/2 connection pool
// implementations. If not specified, there is no limit. Setting this // implementations. If not specified, there is no limit. Setting this
// parameter to 1 will effectively disable keep alive. // parameter to 1 will effectively disable keep alive.
google.protobuf.UInt32Value max_requests_per_connection = 10; google.protobuf.UInt32Value max_requests_per_connection = 9;
// Optional circuit breaking settings for the cluster. // Optional circuit breaking settings for the cluster.
CircuitBreakers circuit_breakers = 11; CircuitBreakers circuit_breakers = 10;
// The TLS configuration for connections to the upstream cluster. If no TLS // The TLS configuration for connections to the upstream cluster. If no TLS
// configuration is specified, TLS will not be used for new connections. // configuration is specified, TLS will not be used for new connections.
UpstreamTlsContext tls_context = 12; UpstreamTlsContext tls_context = 11;
oneof protocol_options { oneof protocol_options {
TcpProtocolOptions tcp_protocol_options = 13; TcpProtocolOptions tcp_protocol_options = 12;
Http1ProtocolOptions http_protocol_options = 14; Http1ProtocolOptions http_protocol_options = 13;
// Even if default HTTP2 protocol options are desired, this field must be // Even if default HTTP2 protocol options are desired, this field must be
// set so that Envoy will assume that the upstream supports HTTP/2 when // set so that Envoy will assume that the upstream supports HTTP/2 when
// making new HTTP connection pool connections. Currently, Envoy only // making new HTTP connection pool connections. Currently, Envoy only
// supports prior knowledge for upstream connections. Even if TLS is used // supports prior knowledge for upstream connections. Even if TLS is used
// with ALPN, http2 must be specified. As an aside this allows HTTP/2 // with ALPN, http2 must be specified. As an aside this allows HTTP/2
// connections to happen over plain text. // connections to happen over plain text.
Http2ProtocolOptions http2_protocol_options = 15; Http2ProtocolOptions http2_protocol_options = 14;
GrpcProtocolOptions grpc_protocol_options = 16; GrpcProtocolOptions grpc_protocol_options = 15;
} }
// If the dns refresh rate is specified and the cluster type is either // If the dns refresh rate is specified and the cluster type is either
@ -144,7 +141,7 @@ message Cluster {
// rate. If this setting is not specified, the value defaults to 5000. For // rate. If this setting is not specified, the value defaults to 5000. For
// cluster types other than strict_dns and logical_dns this setting is // cluster types other than strict_dns and logical_dns this setting is
// ignored. // ignored.
google.protobuf.Duration dns_refresh_rate = 17; google.protobuf.Duration dns_refresh_rate = 16;
// The DNS IP address resolution policy. The options are v4_only, v6_only, and // The DNS IP address resolution policy. The options are v4_only, v6_only, and
// auto. If this setting is not specified, the value defaults to v4_only. When // auto. If this setting is not specified, the value defaults to v4_only. When
@ -160,14 +157,14 @@ message Cluster {
V4_ONLY = 1; V4_ONLY = 1;
V6_ONLY = 2; V6_ONLY = 2;
} }
DnsLookupFamily dns_lookup_family = 18; DnsLookupFamily dns_lookup_family = 17;
// If DNS resolvers are specified and the cluster type is either strict_dns, // If DNS resolvers are specified and the cluster type is either strict_dns,
// or logical_dns, this value is used to specify the clusters dns resolvers. // or logical_dns, this value is used to specify the clusters dns resolvers.
// If this setting is not specified, the value defaults to the default // If this setting is not specified, the value defaults to the default
// resolver, which uses /etc/resolv.conf for configuration. For cluster types // resolver, which uses /etc/resolv.conf for configuration. For cluster types
// other than strict_dns and logical_dns this setting is ignored. // other than strict_dns and logical_dns this setting is ignored.
ResolvedAddresses dns_resolvers = 19; repeated Address dns_resolvers = 18;
// If specified, outlier detection will be enabled for this upstream cluster. // If specified, outlier detection will be enabled for this upstream cluster.
message OutlierDetection { message OutlierDetection {
@ -213,7 +210,7 @@ message Cluster {
// be 1900. Defaults to 1900. // be 1900. Defaults to 1900.
google.protobuf.UInt32Value success_rate_stdev_factor = 9; google.protobuf.UInt32Value success_rate_stdev_factor = 9;
} }
OutlierDetection outlier_detection = 20; OutlierDetection outlier_detection = 19;
// The interval for removing stale hosts from a cluster type // The interval for removing stale hosts from a cluster type
// original_dst. Hosts are considered stale if they have not been used // original_dst. Hosts are considered stale if they have not been used
@ -226,8 +223,8 @@ message Cluster {
// on opening new connections. If this setting is not specified, the // on opening new connections. If this setting is not specified, the
// value defaults to 5000ms. For cluster types other than original_dst // value defaults to 5000ms. For cluster types other than original_dst
// this setting is ignored. // this setting is ignored.
google.protobuf.Duration cleanup_interval = 21; google.protobuf.Duration cleanup_interval = 20;
// Optional configuration used to bind newly established upstream connections. // Optional configuration used to bind newly established upstream connections.
UpstreamBindConfig upstream_bind_config = 22; UpstreamBindConfig upstream_bind_config = 21;
} }

@ -106,8 +106,13 @@ message FilterChain {
} }
message Listener { message Listener {
// The unique name of the listener. If no name is provided, Envoy will generate a
// UUID for internal use. The name is used for dynamic listener update and removal
// via the LDS APIs.
string name = 1;
// The address that the listener should listen on. // The address that the listener should listen on.
UnresolvedAddress address = 1; Address address = 2;
// A list of filter chains to consider for this listener. The FilterChain with // A list of filter chains to consider for this listener. The FilterChain with
// the most specific FilterChainMatch criteria is used on a connection. The // the most specific FilterChainMatch criteria is used on a connection. The
@ -121,25 +126,20 @@ message Listener {
// a tie. // a tie.
// 3. The longest suffix match on the bound destination address is used to // 3. The longest suffix match on the bound destination address is used to
// select the FilterChain from step 2 that is used. // select the FilterChain from step 2 that is used.
repeated FilterChain filter_chains = 2; repeated FilterChain filter_chains = 3;
// If a connection is redirected using iptables, the port on which the proxy // If a connection is redirected using iptables, the port on which the proxy
// receives it might be different from the original destination port. When // receives it might be different from the original destination port. When
// this flag is set to true, the listener uses the original destination // this flag is set to true, the listener uses the original destination
// address and port during FilterChain matching. Default is false. // address and port during FilterChain matching. Default is false.
google.protobuf.BoolValue use_original_dst = 3; google.protobuf.BoolValue use_original_dst = 4;
// Soft limit on size of the listeners new connection read and write buffers. // Soft limit on size of the listeners new connection read and write buffers.
// If unspecified, an implementation defined default is applied (1MiB). // If unspecified, an implementation defined default is applied (1MiB).
google.protobuf.UInt32Value per_connection_buffer_limit_bytes = 4; google.protobuf.UInt32Value per_connection_buffer_limit_bytes = 5;
// See base.Metadata description. // See base.Metadata description.
Metadata metadata = 5; Metadata metadata = 6;
// The unique name of the listener. If no name is provided, Envoy will generate a
// UUID for internal use. The name is used for dynamic listener update and removal
// via the LDS APIs.
string name = 6;
message DeprecatedV1 { message DeprecatedV1 {
// Whether the listener should bind to the port. A listener that doesnt // Whether the listener should bind to the port. A listener that doesnt

Loading…
Cancel
Save