Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
The Kubernetes Workshop

You're reading from  The Kubernetes Workshop

Product type Book
Published in Sep 2020
Publisher Packt
ISBN-13 9781838820756
Pages 780 pages
Edition 1st Edition
Languages
Authors (6):
Zachary Arnold Zachary Arnold
Profile icon Zachary Arnold
Sahil Dua Sahil Dua
Profile icon Sahil Dua
Wei Huang Wei Huang
Profile icon Wei Huang
Faisal Masood Faisal Masood
Profile icon Faisal Masood
Mélony Qin Mélony Qin
Profile icon Mélony Qin
Mohammed Abu Taleb Mohammed Abu Taleb
Profile icon Mohammed Abu Taleb
View More author details

Table of Contents (20) Chapters

Preface
1. Introduction to Kubernetes and Containers 2. An Overview of Kubernetes 3. kubectl – Kubernetes Command Center 4. How to Communicate with Kubernetes (API Server) 5. Pods 6. Labels and Annotations 7. Kubernetes Controllers 8. Service Discovery 9. Storing and Reading Data on Disk 10. ConfigMaps and Secrets 11. Build Your Own HA Cluster 12. Your Application and HA 13. Runtime and Network Security in Kubernetes 14. Running Stateful Components in Kubernetes 15. Monitoring and Autoscaling in Kubernetes 16. Kubernetes Admission Controllers 17. Advanced Scheduling in Kubernetes 18. Upgrading Your Cluster without Downtime 19. Custom Resource Definitions in Kubernetes

Understanding StatefulSets

In Figure 14.1, we can see that a StatefulSet is invoked to be able to manage pod life cycles. A StatefulSet (in older versions of Kubernetes, this was called a PetSet) operates very similarly to a Deployment in that we provide a pod template of what we want to run and how many instances of it we want to run. What differs between a StatefulSet and a Deployment is the following:

  • A clear naming scheme that can be depended upon by pods in DNS queries:

    This means that in the preceding diagram when we name a StatefulSet mysql, the first pod in that StatefulSet will always be mysql-0. This is unlike a traditional deployment where pod IDs are assigned randomly. It also means that if you had a pod named mysql-2 and it crashed, it would be resurrected on the cluster using exactly the same name.

  • A clearly ordered way in which updates must proceed:

    Depending on the update strategy in this StatefulSet, each pod will be taken down in a very specific order. So...

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 €14.99/month. Cancel anytime}