You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/virtualserver-and-virtualserverroute.md
+76-18
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,26 @@ This document is the reference documentation for the resources. To see additiona
7
7
**Feature Status**: The VirtualServer and VirtualServerRoute resources are available as a preview feature: it is suitable for experimenting and testing; however, it must be used with caution in production environments. Additionally, while the feature is in preview, we might introduce some backward-incompatible changes to the resources specification in the next releases.
8
8
9
9
## Contents
10
-
-[VirtualServer and VirtualServerRoute Resources](#virtualserver-and-virtualserverroute-resources)
-[Common Parts of the VirtualServer and VirtualServerRoute](#Common-Parts-of-the-VirtualServer-and-VirtualServerRoute)
19
+
-[Upstream](#Upstream)
20
+
-[Upstream.TLS](#UpstreamTLS)
21
+
-[Upstream.Healthcheck](#UpstreamHealthcheck)
22
+
-[Header](#Header)
23
+
-[Split](#Split)
24
+
-[Rules](#Rules)
25
+
-[Condition](#Condition)
26
+
-[Match](#Match)
27
+
-[Using VirtualServer and VirtualServerRoute](#Using-VirtualServer-and-VirtualServerRoute)
28
+
-[Validation](#Validation)
29
+
-[Customization via ConfigMap](#Customization-via-ConfigMap)
28
30
29
31
## Prerequisites
30
32
@@ -209,12 +211,68 @@ tls:
209
211
| `next-upstream-timeout` | The time during which a request can be passed to the next upstream server. See the [proxy_next_upstream_timeout](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream_timeout) directive. The `0` value turns off the time limit. The default is `0`. | `string` | No |
210
212
| `next-upstream-tries` | The number of possible tries for passing a request to the next upstream server. See the [proxy_next_upstream_tries](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream_tries) directive. The `0` value turns off this limit. The default is `0`. | `int` | No |
211
213
| `tls` | The TLS configuration for the Upstream. | [`tls`](#UpstreamTLS) | No |
214
+
| `healthCheck` | The health check configuration for the Upstream. See the [health_check](http://nginx.org/en/docs/http/ngx_http_upstream_hc_module.html#health_check) directive. Note: this feature is supported only in NGINX Plus. | [`healthcheck`](#UpstreamHealthcheck) | No |
212
215
213
216
### Upstream.TLS
214
217
| Field | Description | Type | Required |
215
218
| ----- | ----------- | ---- | -------- |
216
219
| `enable` | Enables HTTPS for requests to upstream servers. The default is `False`, meaning that HTTP will be used. | `boolean` | No |
217
220
221
+
### Upstream.Healthcheck
222
+
223
+
The Healthcheck defines an [active health check](https://docs.nginx.com/nginx/admin-guide/load-balancer/http-health-check/). In the example below we enable a health check for an upstream and configure all the available parameters:
224
+
225
+
```yaml
226
+
name: tea
227
+
service: tea-svc
228
+
port: 80
229
+
healthCheck:
230
+
enable: true
231
+
path: /healthz
232
+
interval: 20s
233
+
jitter: 3s
234
+
fails: 5
235
+
passes: 5
236
+
port: 8080
237
+
tls:
238
+
enable: true
239
+
connect-timeout: 10s
240
+
read-timeout: 10s
241
+
send-timeout: 10s
242
+
headers:
243
+
- name: Host
244
+
value: my.service
245
+
statusMatch: "! 500"
246
+
```
247
+
248
+
| Field | Description | Type | Required |
249
+
| ----- | ----------- | ---- | -------- |
250
+
| `enable` | Enables a health check for an upstream server. The default is `false`. | `boolean` | No |
251
+
| `path` | The path used for health check requests. The default is `/`. | `string` | No |
252
+
| `interval` | The interval between two consecutive health checks. The default is `5s`. | `string` | No |
253
+
| `jitter` | The time within which each health check will be randomly delayed. By default, there is no delay. | `string` | No |
254
+
| `fails` | The number of consecutive failed health checks of a particular upstream server after which this server will be considered unhealthy. The default is `1`. | `integer` | No |
255
+
| `passes` | The number of consecutive passed health checks of a particular upstream server after which the server will be considered healthy. The default is `1`. | `integer` | No |
256
+
| `port` | The port used for health check requests. By default, the port of the upstream is used. Note: in contrast with the port of the upstream, this port is not a service port, but a port of a pod. | `integer` | No |
257
+
| `tls` | The TLS configuration used for health check requests. By default, the `tls` field of the upstream is used. | [`upstream.tls`](#UpstreamTLS) | No |
258
+
| `connect-timeout` | The timeout for establishing a connection with an upstream server. By default, the `connect-timeout` of the upstream is used. | `string` | No |
259
+
| `read-timeout` | The timeout for reading a response from an upstream server. By default, the `read-timeout` of the upstream is used. | `string` | No |
260
+
| `send-timeout` | The timeout for transmitting a request to an upstream server. By default, the `send-timeout` of the upstream is used. | `string` | No |
261
+
| `headers` | The request headers used for health check requests. NGINX Plus always sets the `Host`, `User-Agent` and `Connection` headers for health check requests. | [`[]header`](#Header) | No |
262
+
| `statusMatch` | The expected response status codes of a health check. By default, the response should have status code 2xx or 3xx. Examples: `“200”`, `“! 500”`, `"301-303 307"`. See the documentation of the [match](https://nginx.org/en/docs/http/ngx_http_upstream_hc_module.html?#match) directive. | `string` | No |
263
+
264
+
### Header
265
+
The header defines an HTTP Header:
266
+
```yaml
267
+
name: Host
268
+
value: example.com
269
+
```
270
+
271
+
| Field | Description | Type | Required |
272
+
| ----- | ----------- | ---- | -------- |
273
+
| `name` | The name of the header. | `string` | Yes |
274
+
| `value` | The value of the header. | `string` | No |
275
+
218
276
### Split
219
277
220
278
The split defines a weight for an upstream as part of the splits configuration.
0 commit comments