How to use GCP Local SSD with KubeDB

9/20/2019

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.

-- Yurik
google-cloud-platform
google-kubernetes-engine
kubedb
kubernetes
postgresql

0 Answers