TNS
VOXPOP
Will JavaScript type annotations kill TypeScript?
The creators of Svelte and Turbo 8 both dropped TS recently saying that "it's not worth it".
Yes: If JavaScript gets type annotations then there's no reason for TypeScript to exist.
0%
No: TypeScript remains the best language for structuring large enterprise applications.
0%
TBD: The existing user base and its corpensource owner means that TypeScript isn’t likely to reach EOL without a putting up a fight.
0%
I hope they both die. I mean, if you really need strong types in the browser then you could leverage WASM and use a real programming language.
0%
I don’t know and I don’t care.
0%
Cloud Native Ecosystem / Kubernetes / Storage

Tutorial: Deploy PostgreSQL on Kubernetes Running the OpenEBS Storage Engine

In the last part of this series, I covered the steps to install OpenEBS on the Amazon Elastic Kubernetes Service (Amazon EKS). In this tutorial, we will deploy a highly available instance of PostgreSQL.
Mar 20th, 2020 8:12am by
Featued image for: Tutorial: Deploy PostgreSQL on Kubernetes Running the OpenEBS Storage Engine
Feature image via Pixabay.

In the last part of this series, I covered the steps to install OpenEBS on the Amazon Elastic Kubernetes Service (Amazon EKS). In this tutorial, we will deploy a highly available instance of PostgreSQL.

Create a Storage Class for PostgreSQL

We will first create a storage class based on the storage pool claim configured in the last tutorial.




The ReplicaCount key will ensure that the data is written across three nodes to add redundancy.



Deploying PostgreSQL through a Helm Chart

We will now deploy PostgreSQL backed by OpenEBS. By pointing the persistence.storageClass to the cStor storage class created in the last step, the deployment will dynamically create a Persistent Volume (PV) and Persistent Volume Claim (PVC)



Let’s verify the Pod, PVC, and PV associated with the deployment.






Creating Test Data

Access the PgSQL client to create a test database, table, and adding a row.

First, let’s retrieve the password from the deployment.







INSERT INTO products VALUES (1, ‘Cheese’, 9.99);


Simulating a Node Failure

Let’s find the node running the PostgreSQL database Pod and cordon it off which will prevent new Pods from being scheduled on it.






Finally, we will delete the Pod running on the cordoned node.

Verifying the Data in the new Pod

As soon as the Pod is deleted, the Kubernetes controller will create a new Pod and schedules it in a different node. It cannot be placed on the same node as the scheduling is disabled after cordoning it.

Even though the PVC has the access mode as ReadWriteOnce which is mounted by a specific node for read-write access, the Pod is able to target the same PVC through the cStor storage pool which abstracted the underlying EBS volumes into a single storage layer.

Now, let’s connect to the new Pod and check if the data is intact.



The data is intact even after deleting the Pod and rescheduling it on a different node. This confirms that the replication factor of OpenEBS is working properly.

In the next part of this series, we will see how to take volume snapshots and backup the state of the workload. Stay tuned!

Janakiram MSV’s Webinar series, “Machine Intelligence and Modern Infrastructure (MI2)” offers informative and insightful sessions covering cutting-edge technologies. Sign up for the upcoming MI2 webinar at http://mi2.live.

Group Created with Sketch.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.