Learn Kubernetes in a Month of Lunches

Book description

In Learn Kubernetes in a Month of Lunches you'll go from "what's a Pod?" to automatically scaling clusters of containers and components in just 22 hands-on lessons, each short enough to fit into a lunch break. Every lesson is task-focused and covers an essential skill on the road to Kubernetes mastery. You'll learn how to smooth container management with Kubernetes, including securing your clusters, and upgrades and rollbacks with zero downtime. No development stack, platform, or background is assumed. Author Elton Stoneman describes all patterns generically, so you can easily apply them to your applications and port them to other projects!

About the Technology
Create apps that perform identically on your laptop, data center, and cloud! Kubernetes provides a consistent method for deploying applications on any platform, making it easy to grow. By efficiently orchestrating Docker containers, Kubernetes simplifies tasks like rolling upgrades, scaling, and self-healing.

About the Book
Learn Kubernetes in a Month of Lunches is your guide to getting up and running with Kubernetes. You'll progress from Kubernetes basics to essential skills, learning to model, deploy, and manage applications in production. Exercises demonstrate how Kubernetes works with multiple languages and frameworks. You'll also practice with new apps, legacy code, and serverless functions.

What's Inside
  • Deploying applications on Kubernetes clusters
  • Understanding the Kubernetes app lifecycle, from packaging to rollbacks
  • Self-healing and scalable apps
  • Using Kubernetes as a platform for new technologies


About the Reader
For readers familiar with Docker and containerization.

About the Author
Elton Stoneman is a Docker Captain, a 11-time Microsoft MVP, and the author of Learn Docker in a Month of Lunches.

Quotes
A must-have resource. I thoroughly recommend it!
- Iain Campbell, Tango Telecom

Everything you need to get you up and running with Kubernetes.
- Marc-Anthony Taylor, yelster Digital GmbH

Written from both the Dev and Ops perspective, this book reads like a delightful journey through the exciting landscape that is Kubernetes.
- Yogesh Shetty, ING

Easy to follow real-world examples of how Kubernetes can and should be used.
- Sander Stad, Waypoint Analytical

Table of contents

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

Product information

  • Title: Learn Kubernetes in a Month of Lunches
  • Author(s): Elton Stoneman
  • Release date: April 2021
  • Publisher(s): Manning Publications
  • ISBN: 9781617297984