| # | |
| # Licensed to the Apache Software Foundation (ASF) under one or more | |
| # contributor license agreements. See the NOTICE file distributed with | |
| # this work for additional information regarding copyright ownership. | |
| # The ASF licenses this file to You under the Apache License, Version 2.0 | |
| # (the "License"); you may not use this file except in compliance with | |
| # the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| additionalProperties: false | |
| properties: | |
| tls: | |
| $ref: ./UpstreamTLSRead.yaml | |
| checks: | |
| anyOf: | |
| - required: | |
| - active | |
| - required: | |
| - active | |
| - passive | |
| properties: | |
| passive: | |
| properties: | |
| unhealthy: | |
| properties: | |
| timeouts: | |
| minimum: 0 | |
| maximum: 254 | |
| default: 7 | |
| type: integer | |
| tcp_failures: | |
| minimum: 0 | |
| maximum: 254 | |
| default: 2 | |
| type: integer | |
| http_failures: | |
| minimum: 0 | |
| maximum: 254 | |
| default: 5 | |
| type: integer | |
| http_statuses: | |
| type: array | |
| uniqueItems: true | |
| items: | |
| minimum: 200 | |
| maximum: 599 | |
| type: integer | |
| minItems: 1 | |
| default: | |
| - 429 | |
| - 500 | |
| - 503 | |
| type: object | |
| healthy: | |
| properties: | |
| successes: | |
| minimum: 0 | |
| maximum: 254 | |
| default: 5 | |
| type: integer | |
| http_statuses: | |
| type: array | |
| uniqueItems: true | |
| items: | |
| minimum: 200 | |
| maximum: 599 | |
| type: integer | |
| minItems: 1 | |
| default: | |
| - 200 | |
| - 201 | |
| - 202 | |
| - 203 | |
| - 204 | |
| - 205 | |
| - 206 | |
| - 207 | |
| - 208 | |
| - 226 | |
| - 300 | |
| - 301 | |
| - 302 | |
| - 303 | |
| - 304 | |
| - 305 | |
| - 306 | |
| - 307 | |
| - 308 | |
| type: object | |
| type: | |
| default: http | |
| enum: | |
| - http | |
| - https | |
| - tcp | |
| type: string | |
| type: object | |
| active: | |
| properties: | |
| host: | |
| pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$ | |
| type: string | |
| concurrency: | |
| default: 10 | |
| type: integer | |
| timeout: | |
| default: 1 | |
| type: number | |
| type: | |
| default: http | |
| enum: | |
| - http | |
| - https | |
| - tcp | |
| type: string | |
| unhealthy: | |
| properties: | |
| tcp_failures: | |
| minimum: 1 | |
| maximum: 254 | |
| default: 2 | |
| type: integer | |
| http_statuses: | |
| type: array | |
| uniqueItems: true | |
| items: | |
| minimum: 200 | |
| maximum: 599 | |
| type: integer | |
| minItems: 1 | |
| default: | |
| - 429 | |
| - 404 | |
| - 500 | |
| - 501 | |
| - 502 | |
| - 503 | |
| - 504 | |
| - 505 | |
| interval: | |
| minimum: 1 | |
| default: 1 | |
| type: integer | |
| http_failures: | |
| minimum: 1 | |
| maximum: 254 | |
| default: 5 | |
| type: integer | |
| timeouts: | |
| minimum: 1 | |
| maximum: 254 | |
| default: 3 | |
| type: integer | |
| type: object | |
| http_req_body: | |
| default: "" | |
| type: string | |
| http_method: | |
| default: GET | |
| enum: | |
| - GET | |
| - POST | |
| - PUT | |
| - DELETE | |
| - PATCH | |
| - HEAD | |
| - OPTIONS | |
| - CONNECT | |
| - TRACE | |
| - PURGE | |
| type: string | |
| http_path: | |
| default: / | |
| type: string | |
| req_headers: | |
| items: | |
| uniqueItems: true | |
| type: string | |
| minItems: 1 | |
| type: array | |
| healthy: | |
| properties: | |
| interval: | |
| minimum: 1 | |
| default: 1 | |
| type: integer | |
| successes: | |
| minimum: 1 | |
| maximum: 254 | |
| default: 2 | |
| type: integer | |
| http_statuses: | |
| type: array | |
| uniqueItems: true | |
| items: | |
| minimum: 200 | |
| maximum: 599 | |
| type: integer | |
| minItems: 1 | |
| default: | |
| - 200 | |
| - 302 | |
| type: object | |
| https_verify_certificate: | |
| default: true | |
| type: boolean | |
| port: | |
| minimum: 1 | |
| maximum: 65535 | |
| type: integer | |
| type: object | |
| type: object | |
| retries: | |
| minimum: 0 | |
| type: integer | |
| create_time: | |
| type: integer | |
| readOnly: true | |
| discovery_type: | |
| type: string | |
| description: discovery type | |
| id: | |
| anyOf: | |
| - pattern: ^[a-zA-Z0-9-_.]+$ | |
| maxLength: 64 | |
| minLength: 1 | |
| type: string | |
| - minimum: 1 | |
| type: integer | |
| service_name: | |
| minLength: 1 | |
| maxLength: 256 | |
| type: string | |
| labels: | |
| patternProperties: | |
| .*: | |
| maxLength: 256 | |
| description: value of label | |
| minLength: 1 | |
| pattern: ^\S+$ | |
| type: string | |
| type: object | |
| description: key/value pairs to specify attributes | |
| desc: | |
| maxLength: 256 | |
| type: string | |
| timeout: | |
| required: | |
| - connect | |
| - send | |
| - read | |
| properties: | |
| connect: | |
| exclusiveMinimum: 0 | |
| type: number | |
| send: | |
| exclusiveMinimum: 0 | |
| type: number | |
| read: | |
| exclusiveMinimum: 0 | |
| type: number | |
| type: object | |
| type: | |
| default: roundrobin | |
| type: string | |
| description: Load balancing algorithm. Built-in values are `roundrobin`, `chash`, `ewma`, and `least_conn`; user-defined balancers can provide other values. | |
| pass_host: | |
| default: pass | |
| enum: | |
| - pass | |
| - node | |
| - rewrite | |
| type: string | |
| description: How to set the `Host` header when proxying to the upstream. | |
| x-enumDescriptions: | |
| pass: Forward the client's original `Host` header. | |
| node: Use the upstream node's hostname. | |
| rewrite: Use the value of `upstream_host`. | |
| scheme: | |
| description: The scheme of the upstream. For L7 proxy, it can be one of grpc/grpcs/http/https/ws/wss. For L4 proxy, it can be one of tcp/tls/udp. For specific protocols, it can be kafka. | |
| enum: | |
| - grpc | |
| - grpcs | |
| - http | |
| - https | |
| - tcp | |
| - tls | |
| - udp | |
| - kafka | |
| - ws | |
| - wss | |
| default: http | |
| x-enumDescriptions: | |
| grpc: Layer 7 gRPC. | |
| grpcs: Layer 7 gRPC over TLS. | |
| http: Layer 7 HTTP. | |
| https: Layer 7 HTTP over TLS. | |
| tcp: Layer 4 TCP. | |
| tls: Layer 4 TCP over TLS. | |
| udp: Layer 4 UDP. | |
| kafka: Apache Kafka protocol. | |
| ws: Frame-aware WebSocket proxying; `enable_websocket` is ignored. | |
| wss: Frame-aware WebSocket proxying over TLS; uses the shared CA trust store, not `tls.ca_certs`. | |
| upstream_host: | |
| pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$ | |
| type: string | |
| discovery_args: | |
| properties: | |
| namespace_id: | |
| type: string | |
| description: namespace id | |
| group_name: | |
| type: string | |
| description: group name | |
| cluster_ids: | |
| description: ids of the kubernetes discovery clusters to get nodes from | |
| uniqueItems: true | |
| items: | |
| type: string | |
| minItems: 1 | |
| type: array | |
| type: object | |
| name: | |
| minLength: 1 | |
| maxLength: 256 | |
| type: string | |
| warm_up_conf: | |
| additionalProperties: false | |
| required: | |
| - slow_start_time_seconds | |
| - min_weight_percent | |
| description: "slow start: ramp a newly observed node up to its configured weight" | |
| type: object | |
| properties: | |
| min_weight_percent: | |
| minimum: 1 | |
| maximum: 100 | |
| type: integer | |
| description: lowest effective weight, as a percentage of the original weight | |
| aggression: | |
| minimum: 0.01 | |
| default: 1 | |
| type: number | |
| description: "shape of the ramp: 1 is linear, above 1 ramps up faster at the beginning, below 1 slower" | |
| startup_grace_period_seconds: | |
| minimum: 0 | |
| default: 0 | |
| type: integer | |
| description: seconds after the data plane started during which a node observed for the first time is considered mature | |
| interval: | |
| minimum: 1 | |
| default: 1 | |
| type: integer | |
| description: seconds between two effective weight refreshes | |
| slow_start_time_seconds: | |
| minimum: 1 | |
| type: integer | |
| description: seconds a new node takes to reach its full weight | |
| key: | |
| type: string | |
| description: the key of chash for dynamic load balancing | |
| hash_on: | |
| enum: | |
| - vars | |
| - header | |
| - cookie | |
| - consumer | |
| - vars_combinations | |
| default: vars | |
| type: string | |
| description: What to hash on when `type` is `chash`. | |
| x-enumDescriptions: | |
| vars: Hash on an NGINX variable specified by `key`. | |
| header: Hash on a request header specified by `key`. | |
| cookie: Hash on a cookie value specified by `key`. | |
| consumer: Hash on the authenticated consumer name. | |
| vars_combinations: Hash on a combination of variables. | |
| keepalive_pool: | |
| properties: | |
| requests: | |
| minimum: 1 | |
| default: 1000 | |
| type: integer | |
| idle_timeout: | |
| minimum: 0 | |
| default: 60 | |
| type: number | |
| size: | |
| minimum: 1 | |
| default: 320 | |
| type: integer | |
| type: object | |
| retry_timeout: | |
| minimum: 0 | |
| type: number | |
| nodes: | |
| anyOf: | |
| - patternProperties: | |
| .*: | |
| minimum: 0 | |
| type: integer | |
| description: weight of node | |
| type: object | |
| - items: | |
| required: | |
| - host | |
| - weight | |
| properties: | |
| host: | |
| pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$ | |
| type: string | |
| metadata: | |
| type: object | |
| description: metadata of node | |
| priority: | |
| default: 0 | |
| type: integer | |
| description: priority of node | |
| weight: | |
| minimum: 0 | |
| type: integer | |
| description: weight of node | |
| port: | |
| minimum: 1 | |
| maximum: 65535 | |
| type: integer | |
| description: port of node | |
| type: object | |
| type: array | |
| update_time: | |
| type: integer | |
| readOnly: true | |
| oneOf: | |
| - required: | |
| - nodes | |
| - required: | |
| - service_name | |
| - discovery_type | |
| type: object | |
| x-source: apisix/schema_def.lua | |
| description: Stored upstream configuration returned by the Admin API. |