Service

object

Service entities, as the name implies, are abstractions of each of your own upstream services. Examples of Services would be a data transformation microservice, a billing API, etc. The main attribute of a Service is its URL (where Kong should proxy traffic to), which can be set as a single string or by specifying its protocol, host, port and path individually. Services are associated to Routes (a Service can have many Routes associated with it). Routes are entry-points in Kong and define rules to match client requests. Once a Route is matched, Kong proxies the request to its associated Service. See the [Proxy Reference][proxy-reference] for a detailed explanation of how Kong proxies traffic.

* Additional properties are NOT allowed.
ca_certificatesarray[string]

Array of CA Certificate object UUIDs that are used to build the trust store while verifying upstream server’s TLS certificate. If set to null when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).

client_certificateobject

Certificate to be used as client certificate while TLS handshaking to the upstream server.

Show Child Parameters
connect_timeoutinteger

The timeout in milliseconds for establishing a connection to the upstream server.

Default:60000

>= 1<= 2147483646

created_atinteger

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

enabledboolean

Whether the Service is active. If set to false, the proxy behavior will be as if any routes attached to it do not exist (404). Default: true.

Default:true

hoststringrequired

The host of the upstream server. Note that the host value is case sensitive.

idstring

A string representing a UUID (universally unique identifier).

>= 1 characters

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
namestring

The Service name.

pathstring

The path to be used in requests to the upstream server.

portinteger

The upstream server port.

Default:80

>= 0<= 65535

protocolstring

The protocol used to communicate with the upstream.

Allowed values:grpcgrpcshttphttpstcptlstls_passthroughudpwswss

Default:http

read_timeoutinteger

The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server.

Default:60000

>= 1<= 2147483646

retriesinteger

The number of retries to execute upon failure to proxy.

Default:5

>= 0<= 32767

tagsarray[string]

A string representing a tag.

tls_sansobject

Additional Subject Alternative Names that can be matched on Upstream server’s TLS certificate (in addition to host).

Show Child Parameters
tls_verifyboolean

Whether to enable verification of upstream server TLS certificate. If set to null, then the Nginx default is respected.

tls_verify_depthinteger

Maximum depth of chain while verifying Upstream server’s TLS certificate. If set to null, then the Nginx default is respected.

>= 0<= 64

updated_atinteger

Unix epoch when the resource was last updated.

urlstring

Helper field to set protocol, host, port and path using a URL. This field is write-only and is not returned in responses.

write_timeoutinteger

The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server.

Default:60000

>= 1<= 2147483646

Example

Target

object

A target is an ip address/hostname with a port that identifies an instance of a backend service. Every upstream can have many targets, and the targets can be dynamically added, modified, or deleted. Changes take effect on the fly. To disable a target, post a new one with weight=0; alternatively, use the DELETE convenience method to accomplish the same. The current target object definition is the one with the latest created_at.

* Additional properties are NOT allowed.
created_atnumber

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

failoverboolean

Whether to use this target only as backup or not.

Default:false

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
tagsarray[string]

A string representing a tag.

targetstringrequired

The target address (ip or hostname) and port. If the hostname resolves to an SRV record, the port value will be overridden by the value from the DNS record.

updated_atnumber

Unix epoch when the resource was last updated.

upstreamobject

The unique identifier or the name of the upstream for which to update the target.

Show Child Parameters
weightinteger

The weight this target gets within the upstream loadbalancer (0-65535). If the hostname resolves to an SRV record, the weight value will be overridden by the value from the DNS record.

Default:100

>= 0<= 65535

Example

TargetWithoutParents

object

A target is an ip address/hostname with a port that identifies an instance of a backend service. Every upstream can have many targets, and the targets can be dynamically added, modified, or deleted. Changes take effect on the fly. To disable a target, post a new one with weight=0; alternatively, use the DELETE convenience method to accomplish the same. The current target object definition is the one with the latest created_at.

* Additional properties are NOT allowed.
created_atnumber

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

failoverboolean

Whether to use this target only as backup or not.

Default:false

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
tagsarray[string]

A string representing a tag.

targetstringrequired

The target address (ip or hostname) and port. If the hostname resolves to an SRV record, the port value will be overridden by the value from the DNS record.

updated_atnumber

Unix epoch when the resource was last updated.

upstreamobject

The unique identifier or the name of the upstream for which to update the target.

Show Child Parameters
weightinteger

The weight this target gets within the upstream loadbalancer (0-65535). If the hostname resolves to an SRV record, the weight value will be overridden by the value from the DNS record.

Default:100

>= 0<= 65535

Example

Upstream

object

The upstream object represents a virtual hostname and can be used to loadbalance incoming requests over multiple services (targets). So for example an upstream named service.v1.xyz for a Service object whose host is service.v1.xyz. Requests for this Service would be proxied to the targets defined within the upstream. An upstream also includes a [health checker][healthchecks], which is able to enable and disable targets based on their ability or inability to serve requests. The configuration for the health checker is stored in the upstream object, and applies to all of its targets.

* Additional properties are NOT allowed.
algorithmstring

Which load balancing algorithm to use.

Allowed values:consistent-hashinglatencyleast-connectionsround-robinsticky-sessions

Default:round-robin

client_certificateobject

If set, the certificate to be used as client certificate while TLS handshaking to the upstream server.

Show Child Parameters
created_atinteger

Unix epoch when the resource was created.

descriptionstring

User-defined entity description. Konnect only field, not synced to the Gateway.

hash_fallbackstring

What to use as hashing input if the primary hash_on does not return a hash (eg. header is missing, or no Consumer identified). Not available if hash_on is set to cookie.

Allowed values:consumercookieheaderipnonepathquery_arguri_capture

Default:none

hash_fallback_headerstring

The header name to take the value from as hash input. Only required when hash_fallback is set to header.

hash_fallback_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_fallback is set to query_arg.

>= 1 characters

hash_fallback_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_fallback is set to uri_capture.

>= 1 characters

hash_onstring

What to use as hashing input. Using none results in a weighted-round-robin scheme with no hashing.

Allowed values:consumercookieheaderipnonepathquery_arguri_capture

Default:none

hash_on_cookiestring

The cookie name to take the value from as hash input. Only required when hash_on or hash_fallback is set to cookie. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.

hash_on_cookie_pathstring

The cookie path to set in the response headers. Only required when hash_on or hash_fallback is set to cookie.

Default:/

hash_on_headerstring

The header name to take the value from as hash input. Only required when hash_on is set to header.

hash_on_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_on is set to query_arg.

>= 1 characters

hash_on_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_on is set to uri_capture.

>= 1 characters

healthchecksobject

The array of healthchecks.

Default:{"active":{"concurrency":10,"healthy":{"http_statuses":[200,302],"interval":0,"successes":0},"http_path":"/","https_verify_certificate":true,"timeout":1,"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,404,500,501,502,503,504,505],"interval":0,"tcp_failures":0,"timeouts":0}},"passive":{"healthy":{"http_statuses":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"successes":0},"type":"http","unhealthy":{"http_failures":0,"http_statuses":[429,500,503],"tcp_failures":0,"timeouts":0}}}

Show Child Parameters
host_headerstring

The hostname to be used as Host header when proxying requests through Kong.

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
namestringrequired

This is a hostname, which must be equal to the host of a Service.

slotsinteger

The number of slots in the load balancer algorithm. If algorithm is set to round-robin, this setting determines the maximum number of slots. If algorithm is set to consistent-hashing, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range 10-65536.

Default:10000

>= 10<= 65536

sticky_sessions_cookiestring

The cookie name to keep sticky sessions.

sticky_sessions_cookie_pathstring

A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes).

Default:/

tagsarray[string]

A string representing a tag.

updated_atinteger

Unix epoch when the resource was last updated.

use_srv_nameboolean

If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream Host.

Default:false

Example

Vault

object

Vault entities are used to configure different Vault connectors. Examples of Vaults are Environment Variables, Hashicorp Vault and AWS Secrets Manager. Configuring a Vault allows referencing the secrets with other entities. For example a certificate entity can store a reference to a certificate and key, stored in a vault, instead of storing the certificate and key within the entity. This allows a proper separation of secrets and configuration and prevents secret sprawl.

* Additional properties are NOT allowed.
configobject

The configuration properties for the Vault which can be found on the vaults’ documentation page.

* Additional properties are allowed.
created_atinteger

Unix epoch when the resource was created.

descriptionstring

The description of the Vault entity.

idstring

A string representing a UUID (universally unique identifier).

managed_byobject

Arbitrary JSON data for client responsible for managing the entity. Konnect only field, not synced to the Gateway.

* Additional properties are allowed.
namestringrequired

The name of the Vault that’s going to be added. Currently, the Vault implementation must be installed in every Kong instance.

prefixstringrequired

The unique prefix (or identifier) for this Vault configuration. The prefix is used to load the right Vault configuration and implementation when referencing secrets with the other entities.

tagsarray[string]

A string representing a tag.

updated_atinteger

Unix epoch when the resource was last updated.

Example