This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.
Education is about inspiring and creating opportunities. I hope this book, and my video training courses, inspire you and create lots of opportunities!
A huge thanks to my family for putting up with me. Im a geek who thinks hes software running on midrange biological hardware. I know its not easy living with me.
Thanks to everyone who watches my Pluralsight and A Cloud Guru training videos. I love connecting with you and appreciate all the feedback Ive had over the years. This feedback is what inspired me to write this book. I think youll love it, and I hope it helps drive your career forward.
0: Preface
Kubernetes is developing fast. With this in mind, Im fully committed to updating this book every year. And when I say update, I mean real updates every word and every concept will be reviewed, and every example will be tested and updated against the latest versions of Kubernetes. Make no mistake, Im 100% committed to making this the best and most useful Kubernetes book in the world.
If an update every year seems like a lot welcome to the new normal.
We no longer live in a world where a 2-year-old book on Kubernetes is valuable. Dont get me wrong, as an author, Id love to write a book and never touch it again for 5 years. Thats just not the world we live in anymore.
Editions Paperbacks, hardbacks, eBooks, audio, and translations
At the time of writing, theres an English language paperback, hardback, and Kindle edition in every Amazon market possible.
The following additional prints are also available (or will be very shortly):
- English language version for the Indian sub-continent version via Shroff Publishers and Amazon.in
- Simplified Chinese paperback via Posts & Telecom Press Co. LTD in China and Amazon.cn
- Russian, Spanish, Portuguese, French, Italian, and German paperbacks and eBooks
eBook copies are available from leanpub.com, Amazon Kindle, and several other subscription-based platforms.
Finally, theres a couple of collectors editions:
- Klingon paperback
- Borg hardback
The Klingon edition has a special front-cover written in Klingon. The Borg edition has a special front-cover written in the Borg language. For both editions, the content of the book is in English, only the covers are in Klingon and Borg. Think of them as collectors editions for Star Trek fans.
The sample app and GitHub repo
The book has a GitHub repo with all the YAML code and examples used throughout the book.
https://github.com/nigelpoulton/TheK8sBook
You dont have to, but Its recommended to clone the repo locally (thats jargon for copying it to your computer). Youll need to install git
and then run the following command.
$ git clone https://github.com/nigelpoulton/TheK8sBook.git
This creates a new folder in your current working directory called TheK8sBook
with all the files you need to follow the examples.
Dont stress if youve never used git. The book walks you through everything you need to do.
Responsible language
The text of the book follows guidelines issued by the Inclusive Naming Initiative (inclusivenaming.org) which promotes responsible language and tries to avoid harmful terms. As an example, the Kubernetes project has replaced the potentially harmful term master with control plane node. This book does the same and attempts to follow all guidance from the inclusive naming initiative.
Feedback and contacting me
If you like the book, please gave it a review and a few stars on Amazon. No pressure though, were all busy.
You can also reach me on any of the following:
- twitter.com/nigelpoulton
- nigelpoulton.com
- linkedin.com/in/nigelpoulton
- youtube.com/nigelpoulton
If you want to submit a content suggestion or a potential fix, drop me an email at tkb@nigelpoulton.com
. Ill do my best to respond.
Enjoy the book!
1: Kubernetes primer
This chapter is split into two main sections.
- Kubernetes background where it came from etc.
- Kubernetes as the Operating System of the cloud
Kubernetes background
Kubernetes is an application orchestrator. For the most part, it orchestrates containerized cloud-native microservices apps. How about that for a sentence full of buzzwords!
Youll come across these terms a lot, so lets take a minute to explain what each of them means.
What is an orchestrator
An orchestrator is a system that deploys and manages applications. It can deploy your applications and dynamically respond to changes. For example, Kubernetes can:
- Deploy your application
- Scale it up and down dynamically based on demand
- Self-heal it when things break
- Perform zero-downtime rolling updates and rollbacks
- Lots more
And the best part about Kubernetes it does all of this without you having to supervise or get involved. Obviously, you have to set things up in the first place, but once youve done that, you sit back and let Kubernetes work its magic.
What is a containerised app
A containerized application is an app that runs in a container.
Before we had containers, applications ran on physical servers or in virtual machines. Containers are just the next iteration of how we package and run apps. As such, theyre faster, more lightweight, and more suited to modern business requirements than servers and virtual machines.
Think of it this way.
- Apps ran on physical servers in the open-systems era (1980s and 1990s)
- Apps ran in virtual machines in the virtualisation era (2000s and into the 2010s)
- Apps run in containers in the cloud-native era (now)
While Kubernetes can orchestrate other workloads, including virtual machines and serverless functions, its most commonly used to orchestrate containerised apps.
What is a cloud-native app
A cloud-native application is one thats designed to meet cloud-like demands of auto-scaling, self-healing, rolling updates, rollbacks and more.
Its important to be clear that cloud-native apps are not applications that will only run in the public cloud. Yes, they absolutely can run on public clouds, but they can also run anywhere that you have Kubernetes, even your on-premises datacenters.
So, cloud-native is about the way applications behave and react to events.
What is a microservices app
A microservices app is built from lots of small, specialised, independent parts that work together to form a meaningful application. For example, you might have an e-commerce app that comprises all of the following small, specialised, independent components: