Skip to content

Commit 2bfa47f

Browse files
bartoszjkevholditch
authored andcommitted
Updated Upstream (#66)
1 parent ffbb1b3 commit 2bfa47f

File tree

7 files changed

+1644
-14
lines changed

7 files changed

+1644
-14
lines changed

README.md

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,81 @@ terraform import kong_sni.<sni_identifier> <sni_id>
307307
## Upstreams
308308
```hcl
309309
resource "kong_upstream" "upstream" {
310-
name = "sample_upstream"
311-
slots = 10
310+
name = "sample_upstream"
311+
slots = 10
312+
hash_on = "header"
313+
hash_fallback = "cookie"
314+
hash_on_header = "HeaderName"
315+
hash_fallback_header = "FallbackHeaderName"
316+
hash_on_cookie = "CookieName"
317+
hash_on_cookie_path = "/path"
318+
healthchecks = {
319+
active = {
320+
type = "https"
321+
http_path = "/status"
322+
timeout = 10
323+
concurrency = 20
324+
https_verify_certificate = false
325+
https_sni = "some.domain.com"
326+
healthy = {
327+
successes = 1
328+
interval = 5
329+
http_statuses = [200, 201]
330+
}
331+
unhealthy = {
332+
timeouts = 7
333+
interval = 3
334+
tcp_failures = 1
335+
http_failures = 2
336+
http_statuses = [500, 501]
337+
}
338+
}
339+
passive = {
340+
type = "https"
341+
healthy = {
342+
successes = 1
343+
http_statuses = [200, 201, 202]
344+
}
345+
unhealthy = {
346+
timeouts = 3
347+
tcp_failures = 5
348+
http_failures = 6
349+
http_statuses = [500, 501, 502]
350+
}
351+
}
352+
}
312353
}
313354
```
314-
`name` is a hostname like name that can be referenced in the upstream_url field of a service.
315-
`slots` is the number of slots in the load balancer algorithm (10-65536, defaults to 10000).
355+
356+
- `name` is a hostname like name that can be referenced in the upstream_url field of a service.
357+
- `slots` is the number of slots in the load balancer algorithm (10-65536, defaults to 10000).
358+
- `hash_on` is a hashing input type: `none `(resulting in a weighted-round-robin scheme with no hashing), `consumer`, `ip`, `header`, or `cookie`. Defaults to `none`.
359+
- `hash_fallback` is a hashing input type if the primary `hash_on` does not return a hash (eg. header is missing, or no consumer identified). One of: `none`, `consumer`, `ip`, `header`, or `cookie`. Not available if `hash_on` is set to `cookie`. Defaults to `none`.
360+
- `hash_on_header` is a header name to take the value from as hash input. Only required when `hash_on` is set to `header`. Default `nil`.
361+
- `hash_fallback_header` is a header name to take the value from as hash input. Only required when `hash_fallback` is set to `header`. Default `nil`.
362+
- `hash_on_cookie` is a 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. Default `nil`.
363+
- `hash_on_cookie_path` is a cookie path to set in the response headers. Only required when `hash_on` or `hash_fallback` is set to `cookie`. Defaults to `/`.
364+
- `healthchecks.active.type` is a active health check type. HTTP or HTTPS, or just attempt a TCP connection. Possible values are `tcp`, `http` or `https`. Defaults to `http`.
365+
- `healthchecks.active.timeout` is a socket timeout for active health checks (in seconds). Defaults to `1`.
366+
- `healthchecks.active.concurrency` is a number of targets to check concurrently in active health checks. Defaults to `10`.
367+
- `healthchecks.active.http_path` is a path to use in GET HTTP request to run as a probe on active health checks. Defaults to `/`.
368+
- `healthchecks.active.https_verify_certificate` check the validity of the SSL certificate of the remote host when performing active health checks using HTTPS. Defaults to `true`.
369+
- `healthchecks.active.https_sni` is the hostname to use as an SNI (Server Name Identification) when performing active health checks using HTTPS. This is particularly useful when Targets are configured using IPs, so that the target host’s certificate can be verified with the proper SNI. Default `nil`.
370+
- `healthchecks.active.healthy.interval` is an interval between active health checks for healthy targets (in seconds). A value of zero indicates that active probes for healthy targets should not be performed. Defaults to `0`.
371+
- `healthchecks.active.healthy.successes` is a number of successes in active probes (as defined by `healthchecks.active.healthy.http_statuses`) to consider a target healthy. Defaults to `0`.
372+
- `healthchecks.active.healthy.http_statuses` is an array of HTTP statuses to consider a success, indicating healthiness, when returned by a probe in active health checks. Defaults to `[200, 302]`.
373+
- `healthchecks.active.unhealthy.interval` is an interval between active health checks for unhealthy targets (in seconds). A value of zero indicates that active probes for unhealthy targets should not be performed. Defaults to `0`.
374+
- `healthchecks.active.unhealthy.tcp_failures` is a number of TCP failures in active probes to consider a target unhealthy. Defaults to `0`.
375+
- `healthchecks.active.unhealthy.http_failures` is a number of HTTP failures in active probes (as defined by `healthchecks.active.unhealthy.http_statuses`) to consider a target unhealthy. Defaults to `0`.
376+
- `healthchecks.active.unhealthy.timeouts` is a number of timeouts in active probes to consider a target unhealthy. Defaults to `0`.
377+
- `healthchecks.active.unhealthy.http_statuses` is an array of HTTP statuses to consider a failure, indicating unhealthiness, when returned by a probe in active health checks. Defaults to `[429, 404, 500, 501, 502, 503, 504, 505]`.
378+
- `healthchecks.passive.type` is a passive health check type. Interpreting HTTP/HTTPS statuses, or just check for TCP connection success. Possible values are `tcp`, `http` or `https` (in passive checks, `http` and `https` options are equivalent.). Defaults to `http`.
379+
- `healthchecks.passive.healthy.successes` is a Number of successes in proxied traffic (as defined by `healthchecks.passive.healthy.http_statuses`) to consider a target healthy, as observed by passive health checks. Defaults to `0`.
380+
- `healthchecks.passive.healthy.http_statuses` is an array of HTTP statuses which represent healthiness when produced by proxied traffic, as observed by passive health checks. Defaults to `[200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308]`.
381+
- `healthchecks.passive.unhealthy.tcp_failures` is a number of TCP failures in proxied traffic to consider a target unhealthy, as observed by passive health checks. Defaults to `0`.
382+
- `healthchecks.passive.unhealthy.http_failures` is a number of HTTP failures in proxied traffic (as defined by `healthchecks.passive.unhealthy.http_statuses`) to consider a target unhealthy, as observed by passive health checks. Defaults to `0`.
383+
- `healthchecks.passive.unhealthy.timeouts` is a number of timeouts in proxied traffic to consider a target unhealthy, as observed by passive health checks. Defaults to `0`.
384+
- `healthchecks.passive.unhealthy.http_statuses` is an array of HTTP statuses which represent unhealthiness when produced by proxied traffic, as observed by passive health checks. Defaults to `[429, 500, 503]`.
316385

317386
To import an upstream:
318387
```

0 commit comments

Comments
 (0)