3

We currently have a 2-node Kubernetes environment running on bare-metal machines (no GCE) and now we wish to set up a PostgreSQL instance on top of this.

Our plan was to map a data volume for the PostgreSQL Data Directory to the node using the volumeMounts option in Kubernetes. However this would be a problem because if the Pod ever gets stopped, Kubernetes will re-launch it at random on one of the other nodes. Thus we have no guarantee that it will use the correct data directory on re-launch...

So what is the best approach for maintaining a consistent and persistent PostgreSQL Data Directory across a Kubernetes cluster?

1 Answer 1

1
  • one solution is to deploy HA postgresql, for example https://github.com/sorintlab/stolon

  • another is to have some network storage attached to all nodes(NFS, glusterFS) and use volumeMounts in the pods

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.