In this article, we’ll deploy PostgreSQL database instances in the Kubernetes cluster. Obviously, PostgreSQL is a database and we need our data to be persisted during container restarts, so we’ll use StatefulSet instead of deployment to manage our PostgreSQL instances that have Persistent volume attached.

PostgreSQL

PostgreSQL (also known as Postgres) is a free and open-source relational database. It’s a SQL compliance database developed by the University of California. Postgres is written in C language, and features transactions with Atomicity, Consistency, Isolation, Durability (ACID) properties, automatically updatable views, triggers, foreign keys, and stored procedures. There’s also managed service of PostgreSQL available in cloud services such as Amazon RDS (Relational Database Service), or Cloud SQL managed by Google Cloud Platform.

StatefulSet

StatefulSet is a Kubernetes object used to manage stateful applications, managing and scaling of applications, and provides a guarantee for ordering and uniqueness of pods. If you want to use persistent storage volumes to provide persistence for your workload, you can use a StatefulSet instead of a deployment. Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.

#kubernetes #k8s #write-for-cloud-native

PostgreSQL on Kuberentes
1.05 GEEK