Merge pull request #4514 from alexmaret/4475-stickyness-mode
Added new affinity mode for maximum session stickyness.
This commit is contained in:
commit
f6c2f5fb97
18 changed files with 572 additions and 138 deletions
|
|
@ -9,6 +9,7 @@ Session affinity can be configured using the following annotations:
|
|||
|Name|Description|Value|
|
||||
| --- | --- | --- |
|
||||
|nginx.ingress.kubernetes.io/affinity|Type of the affinity, set this to `cookie` to enable session affinity|string (NGINX only supports `cookie`)|
|
||||
|nginx.ingress.kubernetes.io/affinity-mode|The affinity mode defines how sticky a session is. Use `balanced` to redistribute some sessions when scaling pods or `persistent` for maximum stickyness.|`balanced` (default) or `persistent`|
|
||||
|nginx.ingress.kubernetes.io/session-cookie-name|Name of the cookie that will be created|string (defaults to `INGRESSCOOKIE`)|
|
||||
|nginx.ingress.kubernetes.io/session-cookie-path|Path that will be set on the cookie (required if your [Ingress paths][ingress-paths] use regular expressions)|string (defaults to the currently [matched path][ingress-paths])|
|
||||
|nginx.ingress.kubernetes.io/session-cookie-max-age|Time until the cookie expires, corresponds to the `Max-Age` cookie directive|number of seconds|
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ You can add these Kubernetes annotations to specific Ingress objects to customiz
|
|||
|---------------------------|------|
|
||||
|[nginx.ingress.kubernetes.io/app-root](#rewrite)|string|
|
||||
|[nginx.ingress.kubernetes.io/affinity](#session-affinity)|cookie|
|
||||
|[nginx.ingress.kubernetes.io/affinity-mode](#session-affinity)|"balanced" or "persistent"|
|
||||
|[nginx.ingress.kubernetes.io/auth-realm](#authentication)|string|
|
||||
|[nginx.ingress.kubernetes.io/auth-secret](#authentication)|string|
|
||||
|[nginx.ingress.kubernetes.io/auth-secret-type](#authentication)|string|
|
||||
|
|
@ -152,6 +153,8 @@ If the Application Root is exposed in a different path and needs to be redirecte
|
|||
The annotation `nginx.ingress.kubernetes.io/affinity` enables and sets the affinity type in all Upstreams of an Ingress. This way, a request will always be directed to the same upstream server.
|
||||
The only affinity type available for NGINX is `cookie`.
|
||||
|
||||
The annotation `nginx.ingress.kubernetes.io/affinity-mode` defines the stickyness of a session. Setting this to `balanced` (default) will redistribute some sessions if a deployment gets scaled up, therefore rebalancing the load on the servers. Setting this to `persistent` will not rebalance sessions to new servers, therefore providing maximum stickyness.
|
||||
|
||||
!!! attention
|
||||
If more than one Ingress is defined for a host and at least one Ingress uses `nginx.ingress.kubernetes.io/affinity: cookie`, then only paths on the Ingress using `nginx.ingress.kubernetes.io/affinity` will use session cookie affinity. All paths defined on other Ingresses for the host will be load balanced through the random selection of a backend server.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue