Thread: Access a Postgres storage with two independent instances
When you apply this configuration file `kubectl apply -f file_name.yaml`, you can create three pods. Here I have given the configuration to create the pods that use a single storage as a data store. But what actually happening is, that it uses separate storage. I have tested all the replicas manually by creating a db and table and see, if other database stores are affected or not. Anyway, it is not affected. And then I tried to apply the same config file change the image name and the env variables suit for MySQL and tried to deploy it. It works as expected. Anyway, it can not use single storage(https://stackoverflow.com/questions/78436945/access-a-mysql-storage-with-two-independent-instances).
Finally, my question is, why the scenario is different for MySQL and Postgres? Could you please help me to figure out the issue? This is for my Final year project testing Kubernetes using fuzzing.
I tried to deploy Postgres deployment with Kubernetes, having three replicas that are accessing the same storage(PVC). Here is the configuration. Anyway, it can not use single storage(https://stackoverflow.com/questions/78436945/access-a-mysql-storage-with-two-independent-instances).Finally, my question is, why the scenario is different for MySQL and Postgres? Could you please help me to figure out the issue? This is for my Final year project testing Kubernetes using fuzzing.
On Tue, 2024-05-07 at 00:47 +0530, first last wrote:I tried to deploy Postgres deployment with Kubernetes, having three replicas that are accessing the same storage(PVC). Here is the configuration. Anyway, it can not use single storage(https://stackoverflow.com/questions/78436945/access-a-mysql-storage-with-two-independent-instances).Finally, my question is, why the scenario is different for MySQL and Postgres? Could you please help me to figure out the issue? This is for my Final year project testing Kubernetes using fuzzing.
Not sure what you're trying to accomplish, but PostgreSQL can definitely not share storage between active postmasters. Nor can MySQL, afaik.
On Tue, 2024-05-07 at 00:47 +0530, first last wrote:I tried to deploy Postgres deployment with Kubernetes, having three replicas that are accessing the same storage(PVC). Here is the configuration. Anyway, it can not use single storage(https://stackoverflow.com/questions/78436945/access-a-mysql-storage-with-two-independent-instances).Finally, my question is, why the scenario is different for MySQL and Postgres? Could you please help me to figure out the issue? This is for my Final year project testing Kubernetes using fuzzing.
Not sure what you're trying to accomplish, but PostgreSQL can definitely not share storage between active postmasters. Nor can MySQL, afaik.
On Tue, 2024-05-07 at 09:56 +0530, first last wrote: > But, when I deploy MySQL/MongoDB deployment with multiple replicas to > access the same storage, the all pods except one become CrashLoopBackOff > state. This is happening for MySQL/Mongo. When it comes to Postgres, I > deployed it with multiple pods, all the pods became healthy and there is > no such CrashLoopBackOff state occurred. But those pods access different > storages for every pod. Why this totally different from MySQL and Mongo? Because it is different software? "Why" questions are notoriously hard to answer (as anyone knows who has ever had children). Shared-storage architectures are not great, because they have a single point of failure and only scale very moderately. So there are no efforts in PostgreSQL to make that work. Yours, Laurenz Albe
Actually what I want is multiple Postgres instances to have read and write access to the same data storage directory. Anyway, that can not be possible as what you say. But, when I deploy MySQL/MongoDB deployment with multiple replicas to access the same storage, the all pods except one become CrashLoopBackOff state. This is happening for MySQL/Mongo. When it comes to Postgres, I deployed it with multiple pods, all the pods became healthy and there is no such CrashLoopBackOff state occurred. But those pods access different storages for every pod. Why this totally different from MySQL and Mongo?