Reputation: 1
I have an issue right now where I'm really not sure what's going on. On Google Cloud I have a cluster that contains two instances. Using Kubernetes I have 2 pods running, one on each machine. When I go to log into the application (using the ExternalIP of the LoadBalancer service) with a persisted user sometimes it just straight up fails to do so and redirects to my homepage. Other times it will log me in.
If however, I scale my application down to a single VM and one pod it works okay and will sign me in every time. Because of this I don't think it's an issue with Flask i.e my application, but something else. It's like when I try to sign in I'm on one machine and when I execute the request the load-balancer picks the other machine and it fails to sign me in, then sometimes it lucks out and gets the same one twice in a row. I don't really even know if that's something that's really even possible, it just what it seems like to me, but then again I'm quite new to all this.
https://github.com/tnolan8/CA674-Cloud-Architecture -> this is the repo which contains my application + my deployment scripts.
This is my actual deployment script: deployment.yml
I'm at a loss as to what might actually be causing this. Any thoughts?
Upvotes: 0
Views: 271
Reputation: 4166
TL;DR It seems like you're using sqlalchemy to store your 'database' state on disk.
You should create a database deployment and change your config to use that database instead.
Details:
Upvotes: 1