Table of contents : Learn Kubernetes in a Month of Lunches contents preface acknowledgments about this book Who should read this book How to use this book Your learning journey Try-it-now exercises Hands-on labs Additional resources About the code liveBook discussion forum about the author Week 1—Fast track to Kubernetes 1 Before you begin 1.1 Understanding Kubernetes 1.2 Is this book for you? 1.3 Creating your lab environment 1.3.1 Download the book’s source code 1.3.2 Install Docker Desktop 1.3.3 Install Docker Community Edition and K3s 1.3.4 Install the Kubernetes command-line tool 1.3.5 Run a single-node Kubernetes cluster in Azure 1.3.6 Run a single-node Kubernetes cluster in AWS 1.3.7 Verify your cluster 1.4 Being immediately effective 2 Running containers in Kubernetes with Pods and Deployments 2.1 How Kubernetes runs and manages containers 2.2 Running Pods with controllers 2.3 Defining Deployments in application manifests 2.4 Working with applications in Pods 2.5 Understanding Kubernetes resource management 2.6 Lab 3 Connecting Pods over the network with Services 3.1 How Kubernetes routes network traffic 3.2 Routing traffic between Pods 3.3 Routing external traffic to Pods 3.4 Routing traffic outside Kubernetes 3.5 Understanding Kubernetes Service resolution 3.6 Lab 4 Configuring applications with ConfigMaps and Secrets 4.1 How Kubernetes supplies configuration to apps 4.2 Storing and using configuration files in ConfigMaps 4.3 Surfacing configuration data from ConfigMaps 4.4 Configuring sensitive data with Secrets 4.5 Managing app configuration in Kubernetes 4.6 Lab 5 Storing data with volumes, mounts, and claims 5.1 How Kubernetes builds the container filesystem 5.2 Storing data on a node with volumes and mounts 5.3 Storing clusterwide data with persistent volumes and claims 5.4 Dynamic volume provisioning and storage classes 5.5 Understanding storage choices in Kubernetes 5.6 Lab 6 Scaling applications across multiple Pods with controllers 6.1 How Kubernetes runs apps at scale 6.2 Scaling for load with Deployments and ReplicaSets 6.3 Scaling for high availability with DaemonSets 6.4 Understanding object ownership in Kubernetes 6.5 Lab Week 2—Kubernetes in the real world 7 Extending applications with multicontainer Pods 7.1 How containers communicate in a Pod 7.2 Setting up applications with init containers 7.3 Applying consistency with adapter containers 7.4 Abstracting connections with ambassador containers 7.5 Understanding the Pod environment 7.6 Lab 8 Running data-heavy apps with StatefulSets and Jobs 8.1 How Kubernetes models stability with StatefulSets 8.2 Bootstrapping Pods with init containers in StatefulSets 8.3 Requesting storage with volume claim templates 8.4 Running maintenance tasks with Jobs and CronJobs 8.5 Choosing your platform for stateful apps 8.6 Lab 9 Managing app releases with rollouts and rollbacks 9.1 How Kubernetes manages rollouts 9.2 Updating Deployments with rollouts and rollbacks 9.3 Configuring rolling updates for Deployments 9.4 Rolling updates in DaemonSets and StatefulSets 9.5 Understanding release strategies 9.6 Lab 10 Packaging and managing apps with Helm 10.1 What Helm adds to Kubernetes 10.2 Packaging your own apps with Helm 10.3 Modeling dependencies in charts 10.4 Upgrading and rolling back Helm releases 10.5 Understanding where Helm fits in 10.6 Lab 11 App development— Developer workflows and CI/CD 11.1 The Docker developer workflow 11.2 The Kubernetes-as-a-Service developer workflow 11.3 Isolating workloads with contexts and namespaces 11.4 Continuous delivery in Kubernetes without Docker 11.5 Evaluating developer workflows on Kubernetes 11.6 Lab Week 3—Preparing for production 12 Empowering self-healing apps 12.1 Routing traffic to healthy Pods using readiness probes 12.2 Restarting unhealthy Pods with liveness probes 12.3 Deploying upgrades safely with Helm 12.4 Protecting apps and nodes with resource limits 12.5 Understanding the limits of self-healing apps 12.6 Lab 13 Centralizing logs with Fluentd and Elasticsearch 13.1 How Kubernetes stores log entries 13.2 Collecting logs from nodes with Fluentd 13.3 Shipping logs to Elasticsearch 13.4 Parsing and filtering log entries 13.5 Understanding logging options in Kubernetes 13.6 Lab 14 Monitoring applications and Kubernetes with Prometheus 14.1 How Prometheus monitors Kubernetes workloads 14.2 Monitoring apps built with Prometheus client libraries 14.3 Monitoring third-party apps with metrics exporters 14.4 Monitoring containers and Kubernetes objects 14.5 Understanding the investment you make in monitoring 14.6 Lab 15 Managing incoming traffic with Ingress 15.1 How Kubernetes routes traffic with Ingress 15.2 Routing HTTP traffic with Ingress rules 15.3 Comparing ingress controllers 15.4 Using Ingress to secure your apps with HTTPS 15.5 Understanding Ingress and ingress controllers 15.6 Lab 16 Securing applications with policies, contexts, and admission control 16.1 Securing communication with network policies 16.2 Restricting container capabilities with security contexts 16.3 Blocking and modifying workloads with webhooks 16.4 Controlling admission with Open Policy Agent 16.5 Understanding security in depth in Kubernetes 16.6 Lab Week 4—Pure and applied Kubernetes 17 Securing resources with role-based access control 17.1 How Kubernetes secures access to resources 17.2 Securing resource access within the cluster 17.3 Binding roles to groups of users and service accounts 17.4 Discovering and auditing permissions with plugins 17.5 Planning your RBAC strategy 17.6 Lab 18 Deploying Kubernetes: Multinode and multiarchitecture clusters 18.1 What’s inside a Kubernetes cluster? 18.2 Initializing the control plane 18.3 Adding nodes and running Linux workloads 18.4 Adding Windows nodes and running hybrid workloads 18.5 Understanding Kubernetes at scale 18.6 Lab 19 Controlling workload placement and automatic scaling 19.1 How Kubernetes schedules workloads 19.2 Directing Pod placement with affinity and antiaffinity 19.3 Controlling capacity with automatic scaling 19.4 Protecting resources with preemption and priorities 19.5 Understanding the controls for managing workloads 19.6 Lab 20 Extending Kubernetes with custom resources and Operators 20.1 How to extend Kubernetes with custom resources 20.2 Triggering workflows with custom controllers 20.3 Using Operators to manage third-party components 20.4 Building Operators for your own applications 20.5 Understanding when to extend Kubernetes 20.6 Lab 21 Running serverless functions in Kubernetes 21.1 How serverless platforms work in Kubernetes 21.2 Triggering functions from HTTP requests 21.3 Triggering functions from events and schedules 21.4 Abstracting serverless functions with Serverless 21.5 Understanding where serverless functions fit 21.6 Lab 22 Never the end 22.1 Further reading by chapter 22.2 Choosing a Kubernetes platform 22.3 Understanding how Kubernetes is built 22.4 Joining the community Appendix A—Packaging applications from source code into Docker Images A.1 Who needs a build server when you have a Dockerfile? A.2 App walkthrough: Java source code A.3 App walkthrough: Node.js source code A.4 App walkthrough: Go source code A.5 Understanding multi-stage Dockerfiles A.6 Lab Appendix B—Adding observability with containerized monitoring B.1 The monitoring stack for containerized applications B.2 Exposing metrics from your application B.3 Running a Prometheus container to collect metrics B.4 Running a Grafana container to visualize metrics B.5 Understanding the levels of observability B.6 Lab Appendix C—Application configuration management in containers C.1 A multi-tiered approach to app configuration C.2 Packaging config for every environment C.3 Loading configuration from the runtime C.4 Configuring legacy apps in the same way as new apps C.5 Understanding why a flexible configuration model pays off C.6 Lab Appendix D—Writing and managing application logs with Docker D.1 Welcome to stderr and stdout! D.2 Relaying logs from other sinks to stdout D.3 Collecting and forwarding container logs D.4 Managing your log output and collection D.5 Understanding the container logging model D.6 Lab index