In just five years, Kubernetes has radically changed the way developers and ops personnel build, deploy, and maintain applications in the cloud. With this book's updated third edition, you'll learn how this popular container orchestrator can help your company achieve new levels of velocity, agility, reliability, and efficiency—whether you're new to distributed systems or have been deploying cloud native apps for some time.

Brendan Burns, Joe Beda, Kelsey Hightower, and Lachlan Evenson—who have worked on Kubernetes at Google and beyond—explain how this system fits into the life cycle of a distributed application. Software developers, engineers, and architects will learn ways to use tools and APIs to automate scalable distributed systems for online services, machine learning applications, or even a cluster of Raspberry Pi computers.

This guide shows you how to:

  • Create a simple cluster to learn how Kubernetes works
  • Dive into the details of deploying an application using Kubernetes
  • Learn specialized objects in Kubernetes, such as DaemonSets, jobs, ConfigMaps, and secrets
  • Explore deployments that tie together the lifecycle of a complete application
  • Get practical examples of how to develop and deploy real-world applications in Kubernetes

Table of Contents

  1. 1. Pods
    1. Pods in Kubernetes
    2. Thinking with Pods
    3. The Pod Manifest
    4. Creating a Pod
    5. Creating a Pod Manifest
    6. Running Pods
    7. Listing Pods
    8. Pod Details
    9. Deleting a Pod
    10. Accessing Your Pod
    11. Using Port Forwarding
    12. Getting More Info with Logs
    13. Running Commands in Your Container with exec
    14. Copying Files to and from Containers
    15. Health Checks
    16. Liveness Probe
    17. Readiness Probe
    18. Types of Health Checks
    19. Resource Management
    20. Resource Requests: Minimum Required Resources
    21. Capping Resource Usage with Limits
    22. Persisting Data with Volumes
    23. Using Volumes with Pods
    24. Different Ways of Using Volumes with Pods
    25. Persisting Data Using Remote Disks
    26. Putting It All Together
    27. Summary
  2. 2. Accessing Kubernetes from Common Programming Languages
    1. The Kubernetes API: A client’s perspective
    2. OpenAPI and generated client libraries
    3. But what about kubectl x ...?
    4. Programming the Kubernetes API
    5. Installing the client libraries
    6. Authenticating to the Kubernetes API
    7. Accessing the Kubernetes API
    8. Putting it all together: Listing & Creating Pods in Python, Java and .NET
    9. Creating & Patching objects
    10. Watching Kubernetes APIs for changes
    11. Interacting with Pods
    12. Conclusion
  3. 3. Policy and Governance for Kubernetes Clusters
    1. Why Policy and Governance Matter
    2. Admission Flow
    3. Policy and Governance with Gatekeeper
    4. What is Open Policy Agent?
    5. Installing Gatekeeper
    6. Configuring policies
    7. Understanding Constraint Templates
    8. Creating Constraints
    9. Audit
    10. Mutation
    11. Data Replication
    12. Metrics
    13. Policy Library
    14. Summary