AKS: Cookie based session affinity Configuration

We are facing an issue with session affinity when we increase the Replicas in the cluster; the problem is when we log in to the website, there is authentication. We are getting authentication many times at the time of login.  

Here I explained why we are getting this issue and how we resolved this.  

When using a single pod in the cluster, we don’t get any authentication error because when the user hits the website load-balancer, the traffic goes to that single replica. It will redirect to the authentication request, and it will succeed if the traffic hits a single pod.  

In our case, when we increased the replica count, the application was not stable and asked for authentication multiple times and failed because the LB traffic was unable to select the right pod. 

Session affinity uses cookies to track session information and potentially maintain login credentials. With session affinity, the application server that handles the first client request generates session information and places it in a Set-Cookie header in the response.  

For this issue, we used to need some corrections in Ingress rules, so we added cookies-based-affinity is true in application gateway Ingress rules, and we can use Sticky sessions or session affinity also. We can give a time limit also for the session. 

For this solution, we solved this issue, and traffic goes to both pods, and the session is saved.

Read this E-Book to get a pulse on Elasticsearch monitoring.

Are you monitoring your Elasticsearch environment to detect problems like unreliable nodes and out-of-memory errors? Know which metrics to monitor & where to start.

Cloud Engineer

Gabriel Chutuape

A technology enthusiast passionate about automation, Gabriel Chutuape is a Cloud Engineer at ISmile Technologies. He’s part of the ISmile Technologies Cloud enablement team that help customers to design/solution/project engineering, integrating and implementing infrastructure technologies & services.

CLOUD Engineer

Gopi Krishna

I’m working as Cloud DevOps Engineer. Expertise in technologies of Kubernetes, cloud services and cloud-native services, and DevOps technologies in various clouds.

Register a Free Cloud ROI Assessment Workshop

Register a Free Cloud ROI Assessment Workshop

Get a Detailed assessment report with recommendations with an assessment report

Schedule free Workshop
Register a Free Cloud ROI Assessment Workshop
Register a Free Cloud ROI Assessment Workshop

Liked what you read !

Please leave a Feedback

5 1 vote
Article Rating
guest
0 Comments
Inline Feedbacks
View all comments

Related articles you may would like to read

How can Docker Containerization Help in Reducing CICD Deployment Costs
0
Would love your thoughts, please comment.x
()
x
Proposals

Know the specific resource requirement for completing a specific project with us.

Blog

Keep yourself updated with the latest updates about Cloud technology, our latest offerings, security trends and much more.

Webinar

Gain insights into latest aspects of cloud productivity, security, advanced technologies and more via our Virtual events.

ISmile Technologies delivers business-specific Cloud Solutions and Managed IT Services across all major platforms maximizing your competitive advantage at an unparalleled value.

Request a Consultation