I have a deployment exposed using node port and I need session affinity in Kubernetes.

467 views
Skip to first unread message

Tapas Bhattacharjee

unread,
Apr 28, 2017, 11:18:20 AM4/28/17
to Kubernetes developer/contributor discussion
I have a deployment exposed using node port and I need session affinity in Kubernetes. Is it possible to achieve without using a load balancer?

Tim Hockin

unread,
Apr 28, 2017, 11:20:02 AM4/28/17
to Tapas Bhattacharjee, Kubernetes developer/contributor discussion
It depends on how what affinity means.  If Client IP is good enough, we do support that.

On Apr 28, 2017 8:18 AM, "Tapas Bhattacharjee" <tapas...@gmail.com> wrote:
I have a deployment exposed using node port and I need session affinity in Kubernetes. Is it possible to achieve without using a load balancer?

--
You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-dev+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/9cef4aa4-3954-444c-91a8-27efc1b5ae28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tapas Bhattacharjee

unread,
Apr 28, 2017, 11:23:16 AM4/28/17
to Kubernetes developer/contributor discussion, tapas...@gmail.com
JSESSIONID would be best to have but client ip is something we can live with. Would you please share any link how I can set that up?


On Friday, April 28, 2017 at 10:20:02 AM UTC-5, Tim Hockin wrote:
It depends on how what affinity means.  If Client IP is good enough, we do support that.
On Apr 28, 2017 8:18 AM, "Tapas Bhattacharjee" <tapas...@gmail.com> wrote:
I have a deployment exposed using node port and I need session affinity in Kubernetes. Is it possible to achieve without using a load balancer?

--
You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.

Tapas Bhattacharjee

unread,
Apr 28, 2017, 11:40:22 AM4/28/17
to Kubernetes developer/contributor discussion, tapas...@gmail.com
I am trying setting service.spec.sessionAffinity to ClientIP.

Tapas Bhattacharjee

unread,
Apr 28, 2017, 11:56:43 AM4/28/17
to Kubernetes developer/contributor discussion, tapas...@gmail.com
with service.spec.sessionAffinity to ClientIP this works perfectly. However any plan to use JSESSIONID?

Tim Hockin

unread,
Apr 28, 2017, 9:11:58 PM4/28/17
to Tapas Bhattacharjee, Kubernetes developer/contributor discussion
Services are L4, so we can't use anything in-process.

To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-dev+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/ca726abc-1146-4265-b54a-3a35792bb341%40googlegroups.com.

Chance Zibolski

unread,
May 3, 2017, 12:45:31 AM5/3/17
to Kubernetes developer/contributor discussion, tapas...@gmail.com
You can achieve cookie based session affinity using the nginx ingress controller. This document describe how to do so: https://github.com/kubernetes/ingress/tree/master/examples/affinity/cookie/nginx
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages