<p>I have 3 replicas of same application running in kubernetes and application exposes an endpoint. Hitting the endpoint sets a boolean variable value to true which is having a use in my application. But the issue is, when hitting the endpoint, the variable is updated only in one of the replicas. How to make the changes in all replicas just by hitting one endpoint?</p>

Gill Varghese Sajan
<p>Seems like you're trying to solve an issue with your app using Kubernetes.
Let me elaborate:</p>

<ol>
<li><p>If you have several pods behind a service, you can't access all of them using a single request. This have been proposed <a href="https://github.com/kubernetes/kubernetes/issues/18755" rel="nofollow noreferrer">here</a>, but in my opinion - isn't best practice.</p></li>
<li><p>If you need to share data between your apps, you can have them communicate with each other using a cluster service.</p></li>
<li><p>You probably assume you can share data using Kubernetes volumes, such as gcePersistentDisk or some other sort of volume, but then again, volumes were not meant to solve <a href="https://stackoverflow.com/questions/31693529/how-to-share-storage-between-kubernetes-pods">such problems</a>.</p></li>
</ol>

<p>In conclusion, the way I would solve such issue, is by having the pods communicate changes with each other. Kubernetes can't solve this for you.</p>

<p>EDIT:
Another approach could be having a shared storage (for example a single pod containing mongoDB for example) but I would say that it's a bit of an overkill for your issue. Also because in order to communicate with this pod you would probably need in-cluster communication anyway.</p>
