Ruby on Rails Full Stack application Scaling Up issue on Kubernetes

12/22/2021

We have a RoR based monolith web application which is deployed over Kubernetes. When we try scale up the application to more than 1 pod, The application is not working as expected, the requests to certain pages are taking us to a whole another page, even for authenticated users after some-minutes it takes them back to login page on refresh or while requesting for another pages.Multi Pods of same full stack web-app

-- Sahil Hussain
kubernetes
kubernetes-ingress
kubernetes-pod
ruby-on-rails

1 Answer

1/20/2022

Update! Actual issue is in session storage where session_id stored in rails cache So, the solution is move the cache storage from Rails cache to Redis cache

Solved: add this line in /config/environment/production.rb

 config.session_store :cache_store, key: "_app_session"
 config.cache_store = :redis_cache_store, { url: "redis://redis:6379/1" }
-- Sahil Hussain
Source: StackOverflow