diff --git a/docs/examples/affinity/cookie/README.md b/docs/examples/affinity/cookie/README.md index 4c17a4cc3..ce0229980 100644 --- a/docs/examples/affinity/cookie/README.md +++ b/docs/examples/affinity/cookie/README.md @@ -9,7 +9,7 @@ Session stickiness is achieved through 3 annotations on the Ingress, as shown in |Name|Description|Values| | --- | --- | --- | |nginx.ingress.kubernetes.io/affinity|Sets the affinity type|string (in NGINX only ``cookie`` is possible| -|nginx.ingress.kubernetes.io/session-cookie-name|Name of the cookie that will be used|string (default to route)| +|nginx.ingress.kubernetes.io/session-cookie-name|Name of the cookie that will be used|string (default to INGRESSCOOKIE)| |nginx.ingress.kubernetes.io/session-cookie-hash|Type of hash that will be used in cookie value|sha1/md5/index| You can create the ingress to test this @@ -36,7 +36,7 @@ Rules: Annotations: affinity: cookie session-cookie-hash: sha1 - session-cookie-name: route + session-cookie-name: INGRESSCOOKIE Events: FirstSeen LastSeen Count From SubObjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- @@ -50,12 +50,12 @@ Date: Fri, 10 Feb 2017 14:11:12 GMT Content-Type: text/html Content-Length: 612 Connection: keep-alive -Set-Cookie: route=a9907b79b248140b56bb13723f72b67697baac3d; Path=/; HttpOnly +Set-Cookie: INGRESSCOOKIE=a9907b79b248140b56bb13723f72b67697baac3d; Path=/; HttpOnly Last-Modified: Tue, 24 Jan 2017 14:02:19 GMT ETag: "58875e6b-264" Accept-Ranges: bytes ``` -In the example above, you can see a line containing the 'Set-Cookie: route' setting the right defined stickiness cookie. +In the example above, you can see a line containing the 'Set-Cookie: INGRESSCOOKIE' setting the right defined stickiness cookie. This cookie is created by NGINX containing the hash of the used upstream in that request. If the user changes this cookie, NGINX creates a new one and redirect the user to another upstream. diff --git a/docs/user-guide/annotations.md b/docs/user-guide/annotations.md index abb37247a..3b8194e03 100644 --- a/docs/user-guide/annotations.md +++ b/docs/user-guide/annotations.md @@ -394,7 +394,7 @@ To configure this setting globally for all Ingress rules, the `whitelist-source- ### Cookie affinity -If you use the ``cookie`` type you can also specify the name of the cookie that will be used to route the requests with the annotation `nginx.ingress.kubernetes.io/session-cookie-name`. The default is to create a cookie named 'route'. +If you use the ``cookie`` type you can also specify the name of the cookie that will be used to route the requests with the annotation `nginx.ingress.kubernetes.io/session-cookie-name`. The default is to create a cookie named 'INGRESSCOOKIE'. In case of NGINX the annotation `nginx.ingress.kubernetes.io/session-cookie-hash` defines which algorithm will be used to 'hash' the used upstream. Default value is `md5` and possible values are `md5`, `sha1` and `index`. The `index` option is not hashed, an in-memory index is used instead, it's quicker and the overhead is shorter Warning: the matching against upstream servers list is inconsistent. So, at reload, if upstreams servers has changed, index values are not guaranteed to correspond to the same server as before! USE IT WITH CAUTION and only if you need to!