-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
lds: Add HTTP API listener. #8170
Changes from 5 commits
677d65b
3799372
c860458
33c5759
0203af1
7df2ae1
137a963
6039c6d
20fb3f5
1be606a
7442342
265c5ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ import "envoy/api/v2/core/base.proto"; | |
import "envoy/api/v2/discovery.proto"; | ||
import "envoy/api/v2/listener/listener.proto"; | ||
import "envoy/api/v2/listener/udp_listener_config.proto"; | ||
import "envoy/api/config/filter/network/http_connection_manager/v2/http_connection_manager.proto"; | ||
|
||
import "google/api/annotations.proto"; | ||
import "google/protobuf/duration.proto"; | ||
|
@@ -45,13 +46,31 @@ service ListenerDiscoveryService { | |
} | ||
} | ||
|
||
// [#comment:next free field: 19] | ||
// [#comment:next free field: 21] | ||
message Listener { | ||
// The unique name by which this listener is known. If no name is provided, | ||
// Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically | ||
// updated or removed via :ref:`LDS <config_listeners_lds>` a unique name must be provided. | ||
string name = 1; | ||
|
||
// [#not-implemented-hide:] | ||
// [#next-major-version: In the v3 API, instead of this messy approach where the enum | ||
// value dictates which fields should be set, we should refactor this message such that | ||
// the fields for each type of listener are each in their own sub-message, and we put the | ||
// sub-messages for each type into a oneof. That way, a given Listener message can | ||
// structurally only contain the fields of the relevant type.] | ||
enum Type { | ||
// Default listener type. Binds to a port. | ||
SOCKET = 0; | ||
// HTTP API listener. This type of listener does not bind to a socket or support L3/L4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For discussion, see the existing deprecated Also, while I think this is fine for v2 in which this message is a bit of a mess, this is one of the examples that I want to clean up in v3 in terms of making the various listener types polymorphic in terms of TCP listener, UDP listener, QUIC listener, API listener, etc. so I think we need to move this entire message into a set of common fields and then a oneof with specific messages for each listener type. I think what you are doing here is OK for v2, but can we add comments to remind us of what we immediately want to clean up for v3? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Added a comment about this. |
||
// filter chains; it simply exposes an HTTP API to the xDS client application. | ||
// The only fields that should be set for this listener type are | ||
// :ref:`name<envoy_api_field_Listener.name>` and | ||
// :ref:`api_http_connection_manager<envoy_api_field_Listener.api_http_connection_manager>`, | ||
API_HTTP = 1; | ||
} | ||
Type type = 19; | ||
|
||
// The address that the listener should listen on. In general, the address must be unique, though | ||
// that is governed by the bind rules of the OS. E.g., multiple listeners can listen on port 0 on | ||
// Linux as the actual port will be allocated by the OS. | ||
|
@@ -203,4 +222,11 @@ message Listener { | |
// <envoy_api_field_listener.UdpListenerConfig.udp_listener_name>` = "raw_udp_listener" for | ||
// creating a packet-oriented UDP listener. If not present, treat it as "raw_udp_listener". | ||
listener.UdpListenerConfig udp_listener_config = 18; | ||
|
||
// [#not-implemented-hide:] | ||
// Used only when the :ref:`type<envoy_api_field_Listener.type>` field is set to | ||
// :ref:`API_HTTP<envoy_api_field_Listener.Type.API_HTTP>`. | ||
// The HttpConnectionManager configuration to be used by the HTTP listener. | ||
envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WDYT about adding an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've attempted to do this. Please let me know if this is not what you had in mind. |
||
api_http_connection_manager = 20; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this causes a circular build loop for proto packages as extensions depend on v2 transitively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. But it's not obvious how to resolve this problem. Any suggestions...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to make a decision whether HCM belongs to the core, or whether HTTP API listener belongs to an extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markdroth let's resolve the discussion below then thinks about this, if we get rid of the port to HCM map then we don't need it.
Or just use Filter message which is the opaque config supports HCM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with waiting until some of the broader issues here are resolved. However, I don't think the discussion below will actually make this issue go away. Even if we remove the port map, we will still want an
HttpConnectionManager
field directly in the listener for the HTTP API listener, since the whole point of this new listener type is that it is always hard-coded to a singleHttpConnectionManager
.Anyway, let's see how things shake out with the broader design discussion below, and then we can come back to this.