This is my proposed kubernetes cluster, I want to be able to run Postgresql database, with my nodes accessing storage machine for storing the data, is this using NFS a good option? How best can I run a database instance here?
Asked
Active
Viewed 330 times
0
-
2I would not use NFS for databases. Also make sure to run a distributed database like https://github.com/CrunchyData/postgres-operator or CockroachDB – Jonas Sep 19 '20 at 06:28
-
Well i am very green to kubernetes I will definately explore that option, and how does crunchy data postgres store the data? on each individual node? – tinashe.chipomho Sep 19 '20 at 08:29
-
Its replicated to all nodes, so it does tolerate that a node goes down. – Jonas Sep 19 '20 at 08:34
-
so sounds like if all nodes participate then one of them is a master, am I still able to specify which folder the data will go? – tinashe.chipomho Sep 19 '20 at 10:29
-
You can also have a look at **Rook** https://rook.io/ – Himadri Ganguly Sep 19 '20 at 13:09
-
Are you trying to use shared volume for all Postgre pod or individual for each one? – Gawain Sep 21 '20 at 12:36
-
my idea was to save all data to the datastore machine, how that will work with the cluster I have no idea how to configure it – tinashe.chipomho Sep 22 '20 at 12:51
1 Answers
2
I recommend you to use helm chart for deploying any kind of data base, it is very handy and easy to deploy, visit the link: https://github.com/bitnami/charts/tree/master/bitnami/postgresql
Any way if you want to deploy Postgresql, first of all you need to create persistent volume(pv) and persistent volume claim(pvc), because you choosed NFS for your cluster storage solution. You have to manually create your pv and pvc.
But kubernetes has storage class solution too, it is better to use some kubernetes volume plugin with internal provisioner like glusterfs or cephfs.
https://kubernetes.io/docs/concepts/storage/storage-classes/