Skip to main content
Version: 1.5.0

ApisixUpstream Reference

FieldTypeDescription
schemestringThe protocol used to talk to the Service, can be http, https, grpc, grpcs default is http.
loadbalancerobjectThe load balancing algorithm of this upstream service
loadbalancer.typestringThe load balancing type, can be roundrobin, ewma, least_conn, chash, default is roundrobin.
loadbalancer.hashOnstringThe hash value source scope, only take effects if the chash algorithm is in use. Values can vars, header, vars_combinations, cookie and consumers, default is vars.
loadbalancer.keystringThe hash key, only in valid if the chash algorithm is used.
retriesintThe retry count.
timeoutobjectThe timeout settings.
timeout.connecttime duration in the form "72h3m0.5s"The connect timeout.
timeout.readtime duration in the form "72h3m0.5s"The read timeout.
timeout.sendtime duration in the form "72h3m0.5s"The send timeout.
healthCheckobjectThe health check parameters, see Health Check for more details.
healthCheck.activeobjectactive health check configuration, which is a mandatory field.
healthCheck.active.typestringhealth check type, can be http, https and tcp, default is http.
healthCheck.active.timeouttime duration in the form "72h3m0.5s"the timeout settings for the probe, default is 1s.
healthCheck.active.concurrencyinthow many probes can be sent simultaneously, default is 10.
healthCheck.active.hoststringhost header in http probe request, only in valid if the active health check type is http or https.
healthCheck.active.portinttarget port to receive probes, it's necessary to specify this field if the health check service exposes by different port, note the port value here is the container port, not the service port.
healthCheck.active.httpPathstringthe HTTP URI path in http probe, only in valid if the active health check type is http or https.
healthCheck.active.strictTLSbooleanwhether to use the strict mode when use TLS, only in valid if the active health check type is https, default is true.
healthCheck.active.requestHeadersarray of stringExtra HTTP requests carried in the http probe, only in valid if the active health check type is http or https.
healthCheck.active.healthyobjectThe conditions to judge an endpoint is healthy.
healthCheck.active.healthy.successesintThe number of consecutive requests needed to set an endpoint as healthy, default is 2.
healthCheck.active.healthy.httpCodesarray of integerGood status codes list to check whether a probe is successful, only in valid if the active health check type is http or https, default is [200, 302].
healthCheck.active.healthy.intervaltime duration in the form "72h3m0.5s"The probes sent interval (for healthy endpoints).
healthCheck.active.unhealthyobjectThe conditions to judge an endpoint is unhealthy.
healthCheck.active.unhealthy.httpFailuresintThe number of consecutive http requests needed to set an endpoint as unhealthy, only in valid if the active health check type is http or https, default is 5.
healthCheck.active.unhealthy.tcpFailuresintThe number of consecutive tcp connections needed to set an endpoint as unhealthy, only in valid if the active health check type is tcp, default is 2.
healthCheck.active.unhealthy.httpCodesarray of integerBad status codes list to check whether a probe is failed, only in valid if the active health check type is http or https, default is [429, 404, 500, 501, 502, 503, 504, 505].
healthCheck.active.unhealthy.intervaltime duration in the form "72h3m0.5s"The probes sent interval (for unhealthy endpoints).
healthCheck.passiveobjectpassive health check configuration, which is an optional field.
healthCheck.passive.typestringhealth check type, can be http, https and tcp, default is http.
healthCheck.passive.healthyobjectThe conditions to judge an endpoint is healthy.
healthCheck.passive.healthy.successesintThe number of consecutive requests needed to set an endpoint as healthy, default is 5.
healthCheck.passive.healthy.httpCodesarray of integerGood status codes list to check whether a probe is successful, only in valid if the active health check type is http or https, default is [200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308].
healthCheck.passive.unhealthyobjectThe conditions to judge an endpoint is unhealthy.
healthCheck.passive.unhealthy.httpFailuresintThe number of consecutive http requests needed to set an endpoint as unhealthy, only in valid if the active health check type is http or https, default is 5.
healthCheck.passive.unhealthy.tcpFailuresintThe number of consecutive tcp connections needed to set an endpoint as unhealthy, only in valid if the active health check type is tcp, default is 2.
healthCheck.passive.unhealthy.httpCodesarray of integerBad status codes list to check whether a probe is failed, only in valid if the active health check type is http or https, default is [429, 404, 500, 501, 502, 503, 504, 505].
portLevelSettingsarraySettings for each individual port.
portLevelSettings.portintThe port number defined in the Kubernetes Service, must be a valid port.
portLevelSettings.schemestringsame as scheme but takes higher precedence.
portLevelSettings.loadbalancerobjectsame as loadbalancer but takes higher precedence.
portLevelSettings.healthCheckobjectsame as healthCheck but takes higher precedence.
subsetsarrayservice subset list, use pod labels to organize service endpoints to different groups.
subsets[].namestringthe subset name.
subsets[].labelsobjectthe subset label map.