Global variables not consistent when using mockoon-cli that's deployed on GCP #1610
-
I'm trying to use the functionality that was introduced as part of this ticket: #1354 When using the Admin API to create a global variable and then again the Admin API to get that global variable, the response it's either the value that i've just set or "Global var not found". (using latest version of mockoon-cli that's deployed on GCP) Curious if anyone ever had this kind of issue before. 👀 Locally it's working fine, but as soon as I deploy my changes, the "caching" issue occurs. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
One question first: when you say GCP, are you talking about a serverless-like solution (App Engine or Cloud Run)? Because in this case it's possible that the state of the mock (global variables and data buckets make the mocks stateful) is lost after the end of the HTTP connection. |
Beta Was this translation helpful? Give feedback.
I just tested with a deployment on our cloud (https://mockoon.com/cloud/) and it's working correctly. We are hosting on GCP but with more traditional VMs on Compute Engine (also due to the stateful nature of the mocks we only deploy one instance of each).
Cloud it be that the k8s cluster load balances multiple instances?
I'm not a k8s specialist but I would recommend that the setup targets only one running instance (no up/down scaling or load balancing). This is what we are doing with the playground (https://playground.mockoon.com) using Cloud Run. Up scaling is kind of ok with sticky sessions, bu downscaling or load balancing without sticky session wouldn't work.