Preface
Kubernetes is an open source system that automates the deployment, scaling, and management of containerized applications. If you are running more than just a few containers or want to automate the management of your containers, you need Kubernetes. This book focuses on guiding you through the advanced management of Kubernetes clusters.
The book begins by explaining the fundamentals behind Kubernetes' architecture and covers Kubernetes' design in detail. You will discover how to run complex stateful microservices on Kubernetes, including such advanced features as horizontal pod autoscaling, rolling updates, resource quotas, and persistent storage backends. Using real-world use cases, you will explore the options for network configuration and understand how to set up, operate, and troubleshoot various Kubernetes networking plugins. Finally, you will learn about custom resource development and utilization in automation and maintenance workflows. This book will also cover some additional concepts based on Kubernetes 1.10 release, such as Promethus, Role-based access control, and API aggregation.
By the end of this book, you'll know everything you need to know to go from intermediate to advanced level.
Who this book is for
The book is for system administrators and developers who have intermediate level of knowledge with Kubernetes and are now waiting to master its advanced features. You should also have basic networking knowledge. This advanced-level book provides a pathway to master Kubernetes.
What this book covers
Chapter 1, Understanding Kubernetes Architecture, will help you understand the design of the Kubernetes systems and appreciate why some of these design choices have been made.
Chapter 2, Creating Kubernetes Clusters, will make you understand the different options for creating kubernetes clusters. You will create several clusters using the tools and examine the clusters.
Chapter 3, Monitoring, Logging, and Troubleshooting, will help you set up and understand monitoring and metering in Kubernetes clusters, and will enable you to identify and troubleshoot typical problems that administrators encounter during day-to-day operations.
Chapter 4, High Availability and Reliability, will help you design Kubernetes in HA, and perform live cluster upgrades. You will learn how to design a Kubernetes architecture for production environments on a large scale.
Chapter 5, Configuring Kubernetes Security, Limits, and Accounts, will make you familiar with configuring Kubernetes security and limits, AAA integration, namespaces, service account configuration, and practice.
Chapter 6, Using Critical Kubernetes Resources, will help you use almost all the latest Kubernetes resources for appropriate use cases in production. You will also learn how to define, version, and deliver them.
Chapter 7, Handling Kubernetes Storage, will make you understand and use Kubernetes storage drivers for persistent volumes. You will learn how Flocker works and how to integrate existing enterprise storages (iSCSI/NFS/FC) into Kubernetes.
Chapter 8, Running Stateful Applications with Kubernetes, will teach you how to transform monolithic stateful applications to microservices running on Kubernetes, suitable for production workload. They will also learn several ways that this can be done with or without the PetSet resource prior to Kubernetes release 1.3. You will be able to fill in the gaps in the available documentation resources.
Chapter 9, Rolling Updates, Scalability, and Quotas, will teach you how rolling updates and horizontal pod autoscaling behave. You will learn how to customize and run scaling testing at production environment. You will be able to use resource quotas for CPU and memory.
Chapter 10, Advanced Kubernetes Networking, will help you determine which networking plugin is suitable in different deployments, and you will learn how to deploy Kubernetes with different network plugins. You will be able to understand iptables load balancing and how to extend them.
Chapter 11, Running Kubernetes on Multiple Clouds and Cluster Federation, will make you understand different options for deploying Kubernetes clusters in production. You will be given instruction on how to provision, run, and automate clusters on Amazon and Google Cloud Engine. You will also deploy geographically federated Kubernetes cluster, and you will be given instruction on how to provision, run, and automate cluster-federated workloads.
Chapter 12, Customizing Kubernetes – API and Plugins, will help you implement third-party resources, understand concepts of enhancing the Kubernetes API, and show you how integrate resources with existing environments. You will learn how schedulers work and how to implement your own scheduling engine. Finally, you will also learn how to implement custom external load balancing for on-premise deployments based on common services such as haproxy or nginx.
Chapter 13, Handling the Kubernetes Package Manager, explains how to handle Kubernetes applications as packages. The chapter starts with Helm Classic and goes through Helm for Kubernetes, and finally covers real-world examples of how to create and update packages in a Helm repository in order to be able to maintain them for production application deployments.
Chapter 14, The Future of Kubernetes, will help you create your own Kubernetes packages and store them in Helm repository. You will get an understanding of delivery pipelines for Kubernetes packages, from repositories to clusters.
To get the most out of this book
To follow the examples in each chapter, you need a recent version of Docker and Kubernetes installed on your machine, ideally Kubernetes 1.10. If your operating system is Windows 10 Professional, you can enable hypervisor mode; otherwise, you will need to install VirtualBox and use a Linux guest OS.
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it from https://www.packtpub.com/sites/default/files/downloads/MasteringKubernetesSecondEdition_ColorImages.pdf.
Conventions used
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Let's check out the nodes in the cluster using get nodes
."
A block of code is set as follows:
type Scheduler struct { config *Config }
Any command-line input or output is written as follows:
> kubectl create -f candy.yamlcandy "chocolate" created
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Let's click on the kubedns
pod."
Note
Warnings or important notes appear like this.
Note
Tips and tricks appear like this.
Get in touch
Feedback from our readers is always welcome.
General feedback: Email [email protected]
and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected]
.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected]
with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Reviews
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.