Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Microservices with Kubernetes

You're reading from   Hands-On Microservices with Kubernetes Build, deploy, and manage scalable microservices on Kubernetes

Arrow left icon
Product type Paperback
Published in Jul 2019
Publisher
ISBN-13 9781789805468
Length 502 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Gigi Sayfan Gigi Sayfan
Author Profile Icon Gigi Sayfan
Gigi Sayfan
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Introduction to Kubernetes for Developers FREE CHAPTER 2. Getting Started with Microservices 3. Delinkcious - the Sample Application 4. Setting Up the CI/CD Pipeline 5. Configuring Microservices with Kubernetes 6. Securing Microservices on Kubernetes 7. Talking to the World - APIs and Load Balancers 8. Working with Stateful Services 9. Running Serverless Tasks on Kubernetes 10. Testing Microservices 11. Deploying Microservices 12. Monitoring, Logging, and Metrics 13. Service Mesh - Working with Istio 14. The Future of Microservices and Kubernetes 15. Other Books You May Enjoy

Using relational databases in Kubernetes

So far, we've used a relational database in all our services, but, as we will soon discover, we didn't have real persistence. First, we'll look at where the data is stored, and then we'll explore how durable it is. Finally, we'll migrate one of the databases to use a StatefulSet for proper persistence and durability.

Understanding where the data is stored

For PostgreSQL, there is a data directory; this directory can be set using the PGDATA environment variable. By default, it is set to /var/lib/postgresql/data:

$ kubectl exec -it link-db-6b9b64db5-zp59g env | grep PGDATA
PGDATA=/var/lib/postgresql/data

Let's take a look at what this directory contains:

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime