0

Is there an example of how to set up a KubeDB PostgreSQL streaming replication cluster, where each pod's data is using Google Cloud's Local SSDs (need 2x375GB SSDs merged for each PG node).

I am aware of local SSDs being temporary - for my usecase, performance and ease of scaling is far more important, and my data can be regenerated within a day.

KubeDB docs in the first link have these two settings, but I am not certain how to configure pod affinity, as well as initialize (merge) two local SSDs into one as part of PostgreSQL initialization.

spec.storageType specifies the type of storage that will be used for Postgres database. It can be Durable or Ephemeral. Default value of this field is Durable. If Ephemeral is used then KubeDB will create Postgres database using EmptyDir volume. In this case, you don’t have to specify spec.storage field. This is useful for testing purpose.

spec.storage specifies the size and StorageClass of PVC that will be dynamically allocated to store data for this database. This storage spec will be passed to the StatefulSet created by KubeDB operator to run database pods. You can specify any StorageClass available in your cluster with appropriate resource requests. If you don’t specify spec.storageType: Ephemeral, then this field is required.

Yuri Astrakhan
  • 8,808
  • 6
  • 63
  • 97
  • 1
    Running with local storage is not a great idea. If you upgrade / reschedule or the nodes get replaced your data will be gone. If you are running with merged SSD's, then might be better to have dedicated Postgres servers. Running them in Kubernetes should rather be done through PVC – Christiaan Vermeulen Sep 20 '19 at 06:04
  • If you are using local for archive, then you can checkout this https://kubedb.com/docs/0.12.0/guides/postgres/snapshot/archiving_to_local/ – Christiaan Vermeulen Sep 20 '19 at 06:06
  • @ChristiaanVermeulen I do not value my data, I need performance and horizontal scalability. In the worst case I can regenerate it in a day. My main goal - mega-fast horizontally scalable cluster of replicas that can grow on demand (with kubedb i can simply increase replica count) – Yuri Astrakhan Sep 20 '19 at 14:18

0 Answers0