]
Petr Kremensky commented on WFWIP-249:
--------------------------------------
More info from discussion:
Martin Choma
9:35 AM
@Jean-Frederic Mesnil Just note regarding cookies. I doubt JSESSIONID cookie is relevant
for OpenShift as it is platform for different languages. So what seems to me as relevant
for openshift is 8695ba418ddbdc20694cde13495bd90c=78c87044937651274b32fab52794c559 from
your example. I assume that is how OpenShift decide where to send the traffic by default.
But then what is sessionAffinity: ClientIP useful for?
{noformat}
If you want to make sure that connections from a particular client are passed to the same
Pod each time, you can select the session affinity based
the on client’s IP addresses by setting service.spec.sessionAffinity to “ClientIP”
{noformat}
Based on this documentation I would expect when sessionAffinity: ClientIP is set only one
pod will serve my requests.
sessionAffinity doesn't cause a requests from a same IP to be
served by single endpont
--------------------------------------------------------------------------------------
Key: WFWIP-249
URL:
https://issues.jboss.org/browse/WFWIP-249
Project: WildFly WIP
Issue Type: Bug
Components: OpenShift
Reporter: Petr Kremensky
Assignee: Jeff Mesnil
Priority: Critical
Labels: operator
It is expected, that if the {{sessionAffinity=true}}, the requests from a client with a
same IP should be served by the same endpoint, using the latest upstream operator with the
quickstart example:
*sessionAffinity=false*
{noformat}
$ oc patch wildflyserver quickstart -p '\[{"op":"replace",
"path":"/spec/sessionAffinity", "value":false}\]' --type
json
$ oc describe service/quickstart-loadbalancer | grep Session
Session Affinity: None
$ for i in {1..4} ; do echo `curl -s quickstart-route-wildfly.apps-crc.testing` ; done
{"ip":"10.128.0.98"}
{"ip":"10.128.0.99"}
{"ip":"10.128.0.98"}
{"ip":"10.128.0.99"}
{noformat}
*sessionAffinity=true*
{noformat}
$ oc patch wildflyserver quickstart -p '[{"op":"replace",
"path":"/spec/sessionAffinity", "value":true}]' --type
json
$ oc describe service/quickstart-loadbalancer | grep Session
Session Affinity: ClientIP
$ for i in {1..4} ; do echo `curl -s quickstart-route-wildfly.apps-crc.testing` ; done
{"ip":"10.128.0.98"}
{"ip":"10.128.0.99"}
{"ip":"10.128.0.98"}
{"ip":"10.128.0.99"}
{noformat}
{{sessionAffinity=true}} should make all responses to be served by the same endpoint