Skip to content

Commit f1a4c87

Browse files
committed
DOC/MINOR: update cookie-persistence to describe current implementation
1 parent 36765c2 commit f1a4c87

File tree

2 files changed

+6
-38
lines changed

2 files changed

+6
-38
lines changed

documentation/README.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -630,15 +630,14 @@ backend-config-snippet: |
630630

631631
#### Cookie Persistence
632632

633-
- Configure sticky session via cookie-based persistence.
634-
635633
##### `cookie-persistence`
636634

637-
Enables persistent connections between a client and a pod by inserting a cookie into the client's browser that is used to remember which backend pod they connected to before.
635+
Enables persistent connections (sticky sessions) between a client and a pod by inserting a cookie into the client's browser that is used to remember which backend pod they connected to before.
636+
Dynamic cookies are used by default via a [dynamic-cookie-key](https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4.2-dynamic-cookie-key) in order to support sticky sessions across multiple Ingress Controller instances/replicas.
638637

639638
Available on: `configmap` `ingress` `service`
640639

641-
:information_source: This will insert the following cookie configuration in the corresponding backend `cookie <cookie-name> insert indirect nocache` with `<cookie-name>` the value of this annotation.
640+
:information_source: This will insert the following cookie configuration in the corresponding backend `cookie <cookie-name> insert indirect nocache dynamic` with `<cookie-name>` the value of this annotation.
642641

643642
Possible values:
644643

@@ -650,19 +649,6 @@ Example:
650649
cookie-persistence: "mycookie"
651650
```
652651

653-
Configuring the cookie can be done in two different ways:
654-
- Using `cookie-persistence` annotation.
655-
However, currently, this **does not work** when deploying more than one ingress controller pod. For such case (multiple IC pods) the following `dynamic` cookie configuration via `backend-config-snippet` annotation an be used.
656-
- Using [`backend-config-snippet`](#config-snippet) annotation for more cookie options.
657-
658-
```yaml
659-
backend-config-snippet: |
660-
dynamic-cookie-key ahgh5kiM
661-
cookie SRV insert indirect nocache dynamic
662-
```
663-
664-
More information can be found in the official HAProxy [documentation](https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4-cookie)
665-
666652
<p align='right'><a href='#available-annotations'>:arrow_up_small: back to top</a></p>
667653

668654
***

documentation/doc.yaml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -388,22 +388,6 @@ groups:
388388
- Insert raw HAProxy configuration in specific HAProxy config sections.
389389
- There is **no data validation** done by Ingress Controller. If input is incorrect, HAProxy will fail to apply new configuration.
390390
- It is possible to use [pattern files](controller.md/#--configmap-patternfiles) inside config snippets.
391-
cookie-persistence:
392-
header: |-
393-
- Configure sticky session via cookie-based persistence.
394-
footer: |-
395-
Configuring the cookie can be done in two different ways:
396-
- Using `cookie-persistence` annotation.
397-
However, currently, this **does not work** when deploying more than one ingress controller pod. For such case (multiple IC pods) the following `dynamic` cookie configuration via `backend-config-snippet` annotation an be used.
398-
- Using [`backend-config-snippet`](#config-snippet) annotation for more cookie options.
399-
400-
```yaml
401-
backend-config-snippet: |
402-
dynamic-cookie-key ahgh5kiM
403-
cookie SRV insert indirect nocache dynamic
404-
```
405-
406-
More information can be found in the official HAProxy [documentation](https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4-cookie)
407391
CORS:
408392
header: |-
409393
- *Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any other origins (domain, scheme, or port) than its own from which a browser should permit loading of resources.* - [Mozilla Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
@@ -814,15 +798,13 @@ annotations:
814798
stick on req.cook(sessionid)
815799
- title: cookie-persistence
816800
type: string
817-
group: cookie-persistence
818-
dependencies: ""
819-
default: ""
820801
description:
821-
- Enables persistent connections between a client and a pod by inserting a cookie
802+
- Enables persistent connections (sticky sessions) between a client and a pod by inserting a cookie
822803
into the client's browser that is used to remember which backend pod they connected
823804
to before.
805+
- Dynamic cookies are used by default via a [dynamic-cookie-key](https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4.2-dynamic-cookie-key) in order to support sticky sessions across multiple Ingress Controller instances/replicas.
824806
tip:
825-
- This will insert the following cookie configuration in the corresponding backend `cookie <cookie-name> insert indirect nocache` with `<cookie-name>` the value of this annotation.
807+
- This will insert the following cookie configuration in the corresponding backend `cookie <cookie-name> insert indirect nocache dynamic` with `<cookie-name>` the value of this annotation.
826808
values:
827809
- A name for the cookie
828810
applies_to:

0 commit comments

Comments
 (0)