Book Image

The Kubernetes Bible

By : Nassim Kebbani, Piotr Tylenda, Russ McKendrick
4 (3)
Book Image

The Kubernetes Bible

4 (3)
By: Nassim Kebbani, Piotr Tylenda, Russ McKendrick

Overview of this book

With its broad adoption across various industries, Kubernetes is helping engineers with the orchestration and automation of container deployments on a large scale, making it the leading container orchestration system and the most popular choice for running containerized applications. This Kubernetes book starts with an introduction to Kubernetes and containerization, covering the setup of your local development environment and the roles of the most important Kubernetes components. Along with covering the core concepts necessary to make the most of your infrastructure, this book will also help you get acquainted with the fundamentals of Kubernetes. As you advance, you'll learn how to manage Kubernetes clusters on cloud platforms, such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP), and develop and deploy real-world applications in Kubernetes using practical examples. Additionally, you'll get to grips with managing microservices along with best practices. By the end of this book, you'll be equipped with battle-tested knowledge of advanced Kubernetes topics, such as scheduling of Pods and managing incoming traffic to the cluster, and be ready to work with Kubernetes on cloud platforms.
Table of Contents (28 chapters)
1
Section 1: Introducing Kubernetes
5
Section 2: Diving into Kubernetes Core Concepts
12
Section 3: Using Managed Pods with Controllers
17
Section 4: Deploying Kubernetes on the Cloud
21
Section 5: Advanced Kubernetes

What this book covers

Chapter 1, Kubernetes Fundamentals, is an introduction to Kubernetes. We're going to explain what Kubernetes is, why it was created, who created it, who is making this project alive, and when and why you should use it as part of your stack.

Chapter 2, Kubernetes Architecture – from Docker Images to Running Pods, covers how Kubernetes is built as a distributed software, and is technically not a single monolith binary but built as a set of microservices interacting with each other. We're going to explain this architecture and how Kubernetes proceeds to translate your instructions into running Docker containers.

Chapter 3, Installing Your First Kubernetes Cluster, explains that Kubernetes is really difficult to install due to its distributed nature, so to make the process easier, it is possible to install by using one of its distributions. Kind and Minikube are two options we're going to discover in this chapter to have a Kubernetes cluster working on your machine.

Chapter 4, Running Your Docker Containers, is an introduction to the concept of Pods.

Chapter 5, Using Multi-Container Pods and Design Patterns, introduces multi-container Pods and the design patterns, such as a proxy or sidecar that you can build when running several containers as part of the same Pod.

Chapter 6, Configuring Your Pods Using ConfigMaps and Secrets, explains how, in Kubernetes, we separate Kubernetes applications from their configurations. Both applications and configurations have their own life cycle thanks to the ConfigMap and Secret resources. This chapter will be dedicated to these two objects and how to mount data in ConfigMap and Secret as environment variables or volumes mounted on your Pod.

Chapter 7, Exposing Your Pods with Services, teaches you the notion of services in Kubernetes. Each Pod in Kubernetes gets assigned its own IP address dynamically. Services are extremely useful if you want to provide a consistent one to expose Pods within your cluster to other Pods or to the outside world, with a single static DNS name. You'll learn here that there are three main service types, called ClusterIp, NodePort, and LoadBalancer, which are all dedicated to a single use case in terms of Pod exposition.

Chapter 8, Managing Namespaces in Kubernetes, explains how using namespaces is a key aspect of cluster management and forcibly, you'll have to deal with namespaces during your journey with Kubernetes. Though it's a simple notion, it is a key one, and you'll have to master namespaces perfectly in order to be successful with Kubernetes.

Chapter 9, Persistent Storage in Kubernetes, covers how, by default, Pods are not persistent. As they're just managing raw Docker containers in the end, destroying them will result in the loss of your data. The solution to that is the usage of persistent storage thanks to the PersistentVolume and PersistentVolumeClaim resource kinds. This chapter is dedicated to these two objects and the StorageClass object: it will teach you that Kubernetes is extremely versatile in terms of storage and that your Pods can be interfaced with a lot of different storage technologies.

Chapter 10, Running Production-Grade Kubernetes Workloads, takes a deep dive into high availability and fault tolerance in Kubernetes using ReplicationController and ReplicaSet.

Chapter 11, Deployment – Deploying Stateless Applications, is a continuation of the previous chapter and explains how to manage multiple versions of ReplicaSets using the Deployment object. This is the basic building block for stateless applications running on Kubernetes.

Chapter 12, StatefulSet – Deploying Stateful Applications, takes a look at the next important Kubernetes object: StatefulSet. This object is the backbone of running stateful applications on Kubernetes. We explain the most important differences between running stateless and stateful applications using Kubernetes.

Chapter 13, DaemonSet – Maintaining Pod Singletons on Nodes, covers DaemonSet, which is a special Kubernetes object that can be used for running operational or supporting workloads on Kubernetes clusters. Whenever you need to run precisely one container Pod on a single Kubernetes node, DaemonSet is what you need.

Chapter 14, Kubernetes Clusters on Google Kubernetes Engine, looks at how we can move our Kubernetes workload to Google Cloud using both the native command-line client and the Google Cloud console.

Chapter 15, Launching a Kubernetes Cluster on Amazon Web Services with Amazon Elastic Kubernetes Service, looks at moving the workload we launched in the previous chapter to Amazon's Kubernetes offering.

Chapter 16, Kubernetes Clusters on Microsoft Azure with Azure Kubernetes Service, looks at launching a cluster in Microsoft Azure.

Chapter 17, Working with Helm Charts, covers Helm Charts, which is a dedicated packaging and redistribution tool for Kubernetes applications. Armed with knowledge from this chapter, you will be able to quickly set up your Kubernetes development environment or even plan for the redistribution of your Kubernetes application as a dedicated Helm Chart.

Chapter 18, Authentication and Authorization on Kubernetes, covers authorization using built-in role-based access control and authorization schemes together with user management.

Chapter 19, Advanced Techniques for Scheduling Pods, takes a deeper look at Node affinity, Node taints and tolerations, and advanced scheduling policies in general.

Chapter 20, Autoscaling Kubernetes Pods and Nodes, introduces the principles behind autoscaling in Kubernetes and explains how to use Vertical Pod Autoscaler, Horizontal Pod Autoscaler, and Cluster Autoscaler.

Chapter 21, Advanced Traffic Routing with Ingress, covers Ingress objects and IngressController in Kubernetes. We explain how to use nginx as an implementation of IngressController and how you can use Azure Application Gateway as a native IngressController in Azure environments.