- API gateway configuration entry reference
- Introduction
- Configuration model
- Complete configuration
- Specification
Kind
Name
Namespace
EnterpriseEnterprisePartition
EnterpriseEnterpriseMeta
Listeners[]
Listeners[].Name
Listeners[].Port
Listeners[].Hostname
Listeners[].Protocol
Listeners[].TLS
Listeners[].TLS.MaxVersion
Listeners[].TLS.MinVersion
Listeners[].TLS.CipherSuites[]
Listeners[].TLS.Certificates[]
Listeners[].TLS.Certificates[].Kind
Listeners[].TLS.Certificates[].Name
Listeners[].TLS.Certificates[].Namespace
EnterpriseEnterpriseListeners[].TLS.Certificates[].Partition
EnterpriseEnterprise
API gateway configuration entry reference
This topic provides reference information for the API gateway configuration entry that you can deploy to networks in virtual machine (VM) environments. For reference information about configuring Consul API gateways on Kubernetes, refer to Gateway Resource Configuration.
Introduction
A gateway is a type of network infrastructure that determines how service traffic should be handled. Gateways contain one or more listeners that bind to a set of hosts and ports. An HTTP Route or TCP Route can then attach to a gateway listener to direct traffic from the gateway to a service.
Configuration model
The following list outlines field hierarchy, language-specific data types, and requirements in an api-gateway
configuration entry. Click on a property name to view additional details, including default values.
- Kind: string | must be
"api-gateway"
- Name: string | no default
- Namespace: string | no default EnterpriseEnterprise
- Partition: string | no default EnterpriseEnterprise
- Meta: map | no default
- Listeners: list of objects | no default
- Name: string | no default
- Port: number | no default
- Hostname: string |
"*"
- Protocol: string |
"tcp"
- TLS: map | none
- MinVersion: string | no default
- MaxVersion: string | no default
- CipherSuites: list of strings | Envoy default cipher suites
- Certificates: list of objects | no default
Complete configuration
When every field is defined, an api-gateway
configuration entry has the following form:
Kind = "api-gateway"
Name = "<name of api gateway>"
Namespace = "<enterprise: namespace of the gateway>"
Partition = "<enterprise: partition of the gateway>"
Meta = {
<any key> = "<any value>"
}
Listeners = [
{
Port = <external service port>
Name = "<unique name for this listener>"
Protocol = "<protocol used by external service>"
TLS = {
MaxVersion = "<version of TLS>"
MinVersion = "<version of TLS>"
CipherSuites = [
"<cipher suite>"
]
Certificates = [
{
Kind = "inline-certificate"
Name = "<name of inline-certificate>"
Namespace = "<enterprise: namespace of the certificate>"
Partition = "<enterprise: partition of the certificate>"
}
]
}
}
]
{
"Kind": "api-gateway",
"Name": "<name of api gateway>",
"Namespace": "<enterprise: namespace of the gateway>",
"Partition": "<enterprise: partition of the gateway>",
"Meta": {
"<any key>": "<any value>"
},
"Listeners": [
{
"Name": "<unique name for this listener>",
"Port": <external service port>,
"Protocol": "<protocol used by external service>",
"TLS": {
"MaxVersion": "<version of TLS>",
"MinVersion": "<version of TLS>",
"CipherSuites": [
"<cipher suite>"
],
"Certificates": [
{
"Kind": "inline-certificate",
"Name": "<name of inline-certificate>",
"Namespace": "<enterprise: namespace of the certificate>",
"Partition": "<enterprise: partition of the certificate>"
}
]
}
}
]
}
Specification
This section provides details about the fields you can configure in the api-gateway
configuration entry.
Kind
Specifies the type of configuration entry to implement. This must be api-gateway
.
Values
- Default: none
- This field is required.
- Data type: string value that must be set to
"api-gateway"
.
Name
Specifies a name for the configuration entry. The name is metadata that you can use to reference the configuration entry when performing Consul operations, such as applying a configuration entry to a specific cluster.
Values
- Default: none
- This field is required.
- Data type: string
Namespace
EnterpriseEnterprise
Specifies the Enterprise namespace to apply to the configuration entry.
Values
- Default:
"default"
in Enterprise - Data type: string
Partition
EnterpriseEnterprise
Specifies the Enterprise admin partition to apply to the configuration entry.
Values
- Default:
"default"
in Enterprise - Data type: string
Meta
Specifies an arbitrary set of key-value pairs to associate with the gateway.
Values
- Default: none
- Data type: map containing one or more keys and string values.
Listeners[]
Specifies a list of listeners that gateway should set up. Listeners are uniquely identified by their port number.
Values
- Default: none
- This field is required.
- Data type: List of maps. Each member of the list contains the following fields:
Listeners[].Name
Specifies the unique name for the listener. This field accepts letters, numbers, and hyphens.
Values
- Default: none
- This field is required.
- Data type: string
Listeners[].Port
Specifies the port number that the listener receives traffic on.
Values
- Default:
0
- This field is required.
- Data type: integer
Listeners[].Hostname
Specifies the hostname that the listener receives traffic on.
Values
- Default:
"*"
- This field is optional.
- Data type: string
Listeners[].Protocol
Specifies the protocol associated with the listener.
Values
- Default: none
- This field is required.
- The data type is one of the following string values:
"tcp"
or"http"
.
Listeners[].TLS
Specifies the TLS configurations for the listener.
Values
- Default: none
- Map that contains the following fields:
Listeners[].TLS.MaxVersion
Specifies the maximum TLS version supported for the listener.
Values
- Default depends on the version of Envoy:
- Envoy 1.22.0 and later default to
TLSv1_2
- Older versions of Envoy default to
TLSv1_0
- Envoy 1.22.0 and later default to
- Data type is one of the following string values:
Listeners[].TLS.MinVersion
Specifies the minimum TLS version supported for the listener.
Values
Listeners[].TLS.CipherSuites[]
Specifies a list of cipher suites that the listener supports when negotiating connections using TLS 1.2 or older.
Values
- Defaults to the ciphers supported by the version of Envoy in use. Refer to the Envoy documentation for details.
- Data type: List of string values. Refer to the Consul repository for a list of supported ciphers.
Listeners[].TLS.Certificates[]
The list of references to inline certificates that the listener uses for TLS termination.
Values
- Default: None
- Data type: List of maps. Each member of the list has the following fields:
Listeners[].TLS.Certificates[].Kind
The list of references to inline-certificates that the listener uses for TLS termination.
Values
- Default: None
- This field is required and must be set to
"inline-certificate"
. - Data type: string
Listeners[].TLS.Certificates[].Name
The list of references to inline certificates that the listener uses for TLS termination.
Values
- Default: None
- This field is required.
- Data type: string
Listeners[].TLS.Certificates[].Namespace
EnterpriseEnterprise
Specifies the Enterprise namespace where the certificate can be found.
Values
- Default:
"default"
in Enterprise - Data type: string
Listeners[].TLS.Certificates[].Partition
EnterpriseEnterprise
Specifies the Enterprise admin partition where the certificate can be found.
Values
- Default:
"default"
in Enterprise - Data type: string