Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Introduction to DevOps with Kubernetes

You're reading from   Introduction to DevOps with Kubernetes Build scalable cloud-native applications using DevOps patterns created with Kubernetes

Arrow left icon
Product type Paperback
Published in May 2019
Publisher
ISBN-13 9781789808285
Length 374 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Süleyman Akbaş Süleyman Akbaş
Author Profile Icon Süleyman Akbaş
Süleyman Akbaş
Onur Yılmaz Onur Yılmaz
Author Profile Icon Onur Yılmaz
Onur Yılmaz
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Chapter 1: Introduction to DevOps FREE CHAPTER 2. Chapter 2: Introduction to Microservices and Containers 3. Chapter 3: Introduction to Kubernetes 4. Chapter 4: Creating a Kubernetes Cluster 5. Chapter 5: Deploy an Application to Kubernetes 6. Chapter 6: Configuration and Storage Management in Kubernetes 7. Chapter 7: Updating and Scaling an Application in Kubernetes 8. Chapter 8: Troubleshooting Applications in Kubernetes 9. Chapter 9: Monitoring Applications in Kubernetes Appendix

Chapter 3: Introduction to Kubernetes

Activity 3: Installing a WordPress Blog and Database on Kubernetes

Solution:

Perform the following steps to complete this activity:

  1. Create a two-container stateful set definition inside the wordpress-database.yaml file with the following specifications:

    The nme should be wordpress-database and the replica count should be set to 1. The database container should have the name of database and use the container image of mysql:5.7. Publish the container to port 3306 and mount the data volume to the /var/lib/mysql path. In addition, set the following environment variables:

    Figure 3.24: Environment variables

    Create a blog container with the name blog using the latest WordPress container image and publish the container to port 80. In addition, set the following environment variables:

    Figure 3.25: Environment variables

    Include a volume claim with the name data and 1GB storage.

    The stateful set description as YAML for the specification is as follows...

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
Banner background image