Listener¶
Listener configuration overview
Listener¶
{
"name": "...",
"address": "{...}",
"filter_chains": [],
"use_original_dst": "{...}",
"per_connection_buffer_limit_bytes": "{...}",
"metadata": "{...}",
"drain_type": "...",
"listener_filters": []
}
- name
- (string) 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 LDS a unique name must be provided.
By default, the maximum length of a listener’s name is limited to 60 characters. This limit can
be increased by setting the
--max-obj-name-len
command line argument to the desired value.
- address
- (core.Address, REQUIRED) 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.
- filter_chains
(listener.FilterChain, REQUIRED) A list of filter chains to consider for this listener. The FilterChain with the most specific FilterChainMatch criteria is used on a connection.
Attention
In the current version, multiple filter chains are supported only so that SNI can be configured. See the FAQ entry on how to configure SNI for more information. When multiple filter chains are configured, each filter chain must have an identical set of filters. If the filters differ, the configuration will fail to load. In the future, this limitation will be relaxed such that different filters can be used depending on which filter chain matches (based on SNI or some other parameter).
- use_original_dst
(BoolValue) If a connection is redirected using iptables, the port on which the proxy receives it might be different from the original destination address. When this flag is set to true, the listener hands off redirected connections to the listener associated with the original destination address. If there is no listener associated with the original destination address, the connection is handled by the listener that receives it. Defaults to false.
Attention
This field is deprecated. Use an original_dst listener filter instead.
Note that hand off to another listener is NOT performed without this flag. Once FilterChainMatch is implemented this flag will be removed, as filter chain matching can be used to select a filter chain based on the restored destination address.
- per_connection_buffer_limit_bytes
- (UInt32Value) Soft limit on size of the listener’s new connection read and write buffers. If unspecified, an implementation defined default is applied (1MiB).
- metadata
- (core.Metadata) Listener metadata.
- drain_type
- (Listener.DrainType) The type of draining to perform at a listener-wide level.
- listener_filters
- (listener.ListenerFilter) Listener filters have the opportunity to manipulate and augment the connection metadata that is used in connection filter chain matching, for example. These filters are run before any in filter_chains. Order matters as the filters are processed sequentially right after a socket has been accepted by the listener, and before a connection is created.
Enum Listener.DrainType¶
- DEFAULT
- (DEFAULT) Drain in response to calling /healthcheck/fail admin endpoint (along with the health check filter), listener removal/modification, and hot restart.
- MODIFY_ONLY
- Drain in response to listener removal/modification and hot restart. This setting does not include /healthcheck/fail. This setting may be desirable if Envoy is hosting both ingress and egress listeners.