Skip to main content
Version: Next

ApisixUpstream

See concepts to learn more about how to use the ApisixUpstream resource.

Spec#

See the definition on GitHub.

AttributeTypeDescription
schemestringScheme/Protocol used to talk to the Upstream service. Can be one of http, https, grpc, grpcs. Defaults to http.
loadbalancerobjectLoad balancer configuration.
loadbalancer.typestringLoad balancing algorithm to use. Can be one of roundrobin, ewma, least_conn, or chash. Defaults to roundrobin.
loadbalancer.hashOnstringValue to hash on. Can only be used if the type is chash. Can be one of vars, header, vars_combinations, cookie, and consumers. Defaults to vars.
loadbalancer.keystringHash key. Can only be used if the type is chash.
retriesintNumber of retries while passing the request to the Upstream.
timeoutobjectTimeouts for connecting, sending, and receiving messages between Ingress and the service.
timeout.connectstringConnect timeout in the form "72h3m0.5s".
timeout.readstringRead timeout in the form "72h3m0.5s".
timeout.sendstringSend timeout in the form "72h3m0.5s".
healthCheckobjectConfigures the parameters of the health check.
healthCheck.activeobjectActive health check configuration. Required if configuring health check.
healthCheck.active.typestringHealth check type. Can be one of http, https, or tcp. Defaults to http.
healthCheck.active.timeoutstringTimeout in the form "72h3m0.5s". Defaults to 1s.
healthCheck.active.concurrencyintNumber of probes that can be sent simultaneously. Defaults to 10.
healthCheck.active.hoststringHost header in the HTTP probe request. Valid only if the health check type is http or https.
healthCheck.active.portintTarget port to receive probes. It is required to specify this attribute if the health check service exposes different ports. Note that the port is the container port and not the service port.
healthCheck.active.httpPathstringURI in the HTTP probe request. Valid only if the health check type is http or https.
healthCheck.active.strictTLSbooleanWhen set to true enables the strict TLS mode. Valid only if the health check type is https. Defaults to true.
healthCheck.active.requestHeadersarray of stringsAdditional HTTP request headers carried in the HTTP probe. Valid only if the health check type is http or https.
healthCheck.active.healthyobjectConditions to check to see if an endpoint is healthy.
healthCheck.active.healthy.successesintNumber of consecutive successful requests before an endpoint is set as healthy. By default set to 2.
healthCheck.active.healthy.httpCodesarray of integersStatus codes that will indicate an endpoint is healthy. Valid only if the health check type is http or https. Defaults to [200, 302].
healthCheck.active.healthy.intervalstringSend interval for the probes in the form "72h3m0.5s".
healthCheck.active.unhealthyobjectConditions to check to see if an endpoint is unhealthy.
healthCheck.active.unhealthy.httpFailuresintNumber of consecutive unsuccessful HTTP requests before an endpoint is set as unhealthy. Valid only if the health check type is http or https. By default set to 5.
healthCheck.active.unhealthy.tcpFailuresintNumber of consecutive unsuccessful TCP requests before an endpoint is set as unhealthy. Valid only if the health check type is tcp. By default set to 2.
healthCheck.active.unhealthy.httpCodesarray of integersStatus codes that will indicate an endpoint is unhealthy. Valid only if the health check type is http or https. Defaults to [429, 404, 500, 501, 502, 503, 504, 505].
healthCheck.active.unhealthy.intervalstringSend interval for the probes in the form "72h3m0.5s".
healthCheck.passiveobjectPassive health check configuration.
healthCheck.passive.typestringHealth check type. Can be one of http, https, or tcp. Defaults to http.
healthCheck.passive.healthyobjectConditions to check to see if an endpoint is healthy.
healthCheck.passive.healthy.successesintNumber of consecutive successful requests before an endpoint is set as healthy. By default set to 5.
healthCheck.passive.healthy.httpCodesarray of integersStatus codes that will indicate an endpoint is healthy. Valid only if the health check type is http or https. Defaults to [200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308].
healthCheck.passive.unhealthyobjectConditions to check to see if an endpoint is unhealthy.
healthCheck.passive.unhealthy.httpFailuresintNumber of consecutive unsuccessful HTTP requests before an endpoint is set as unhealthy. Valid only if the health check type is http or https. By default set to 5.
healthCheck.passive.unhealthy.tcpFailuresintNumber of consecutive unsuccessful TCP requests before an endpoint is set as unhealthy. Valid only if the health check type is tcp. By default set to 2.
healthCheck.passive.unhealthy.httpCodesarray of integersStatus codes that will indicate an endpoint is unhealthy. Valid only if the health check type is http or https. Defaults to [429, 404, 500, 501, 502, 503, 504, 505].
portLevelSettingsarraySettings for individual ports.
portLevelSettings.portintValid port number defined in the Kubernetes service.
portLevelSettings.schemestringScheme to use on the specific port. Will override the global scheme attribute.
portLevelSettings.loadbalancerobjectLoad balancer to use on the specific port. Will override the global loadbalancer attribute.
portLevelSettings.healthCheckobjectHealth check configuration on the specific port. Will override the global healthCheck attribute.
subsetsarrayList of service subsets. Use pod labels to organize service endpoints to different groups.
subsets[].namestringName of the subset.
subsets[].labelsobjectLabel map of the subset.
discoveryobjectDiscovery is used to configure Service Discovery for upstream.
discovery.serviceNamestringName of the upstream service.
discovery.typestringTypes of Service Discovery, which indicates what registry in APISIX the discovery uses. Should match the entry in APISIX's config. Can refer to the doc
discovery.argsobjectArgs map for discovery-spcefic parameters. Also can refer to the doc