Kubernetes for Developers

Kubernetes for Developers

Read it now on the O’Reilly learning platform with a 10-day free trial.

O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Book description

A clear and practical beginner’s guide that shows you just how easy it can be to make the switch to Kubernetes!

Kubernetes for Developers reveals practical and painless methods for deploying your apps on Kubernetes—even for small-to-medium sized applications! You’ll learn how to migrate your existing apps onto Kubernetes without a rebuild, and implement modern cloud native architectures that can handle your future growth.

Inside, you’ll learn how to:

About the Technology
Modern software needs to perform at scale while effectively handling load balancing, state and security. Kubernetes makes these tasks easier and more reliable for apps of any size. This book, written especially for software developers creating applications that run on Kubernetes, shows you exactly how to address these and other important issues.

About the Book
Kubernetes for Developers covers everything you need to know to containerize and deploy an app on Kubernetes from the developer’s perspective. You’ll start by creating a small application you can run on a cloud-based Kubernetes cluster. Then, you’ll systematically explore best practices for stable long-term deployment, including scaling, capacity planning, and resource optimization.

About the Reader
For developers familiar with building or deploying web applications. No Docker or Kubernetes experience required.

About the Author
William Denniss is a product manager at Google working on Google Kubernetes Engine.

Quotes
A comprehensive and easy to consume guide with a focus on actually using Kubernetes. It speaks to the vast majority of developers who just want to get their work done and deployed.
- Tim Hockin, Google

A stand out in the crowd of Kubernetes resources. It’s easy to follow, and provides highly focused practical examples.
- Kevin Deggelman, San Francisco Giants

Make your engineering team read this book. It shuts the door on any delays in adopting Kubernetes.
- Dan Garfield, Codefresh

The perfect complement to Kubernetes in Action. Developers need this book.
- Pierre-Michel Ansel, 8x8

Show and hide more Table of contents Product information

Table of contents

  1. inside front cover
  2. Kubernetes for Developers
  3. Copyright
  4. dedication
  5. contents
  6. Front matter
    1. preface
    2. acknowledgments
    3. about this book
      1. Who should read the book
      2. How this book is organized
      1. liveBook discussion forum
      2. Additional online resources
      1. 1.1 Why containers?
        1. 1.1.1 Container benefits
        1. 1.2.1 Composable building blocks
        2. 1.2.2 Features and benefits
        3. 1.2.3 Kubernetes vs. platforms as a service
        4. 1.2.4 When (not) to use Kubernetes
        1. 2.1 Building Docker containers
          1. 2.1.1 Developer setup
          2. 2.1.2 Running commands in Docker
          3. 2.1.3 Building our own images
          4. 2.1.4 Using base images
          5. 2.1.5 Adding a default command
          6. 2.1.6 Adding dependencies
          7. 2.1.7 Compiling code in Docker
          8. 2.1.8 Compiling code with a multistage build
          1. 2.2.1 Containerizing an application server
          2. 2.2.2 Debugging
          1. 2.3.1 Mapping folders locally
          2. 2.3.2 Adding service dependencies
          3. 2.3.3 Faking external dependencies
          1. 3.1 Kubernetes architecture
            1. 3.1.1 The Kubernetes cluster
            2. 3.1.2 Kubernetes objects
            1. 3.2.1 Creating a cluster
            2. 3.2.2 Uploading your container
            3. 3.2.3 Deploying to Kubernetes
            4. 3.2.4 The PodSpec
            5. 3.2.5 Publishing your Service
            6. 3.2.6 Interacting with the Deployment
            7. 3.2.7 Updating your application
            8. 3.2.8 Cleaning up
            1. 3.4.1 Docker Desktop’s Kubernetes cluster
            2. 3.4.2 Minikube
            3. 3.4.3 Using your local Kubernetes cluster
            1. 4.1 Automated uptime with health checks
              1. 4.1.1 Liveness and readiness probes
              2. 4.1.2 Adding a readiness probe
              3. 4.1.3 Adding a liveness probe
              4. 4.1.4 Designing good health checks
              5. 4.1.5 Rescheduling unready containers
              6. 4.1.6 Probe types
              1. 4.2.1 Rolling update strategy
              2. 4.2.2 Re-create strategy
              3. 4.2.3 Blue/green strategy
              4. 4.2.4 Choosing a rollout strategy
              1. 5.1 Pod scheduling
                1. 5.1.1 Specifying Pod resources
                2. 5.1.2 Quality of service
                3. 5.1.3 Evictions, priority, and preemption
                1. 5.2.1 Setting memory requests and limits
                2. 5.2.2 Setting CPU requests and limits
                3. 5.2.3 Reducing costs by overcommitting CPU
                4. 5.2.4 Balancing Pod replicas and internal Pod concurrency
                1. 6.1 Scaling Pods and nodes
                2. 6.2 Horizontal Pod autoscaling
                  1. 6.2.1 External metrics
                  1. 6.3.1 Cluster autoscaling
                  2. 6.3.2 Spare capacity with cluster autoscaling
                  1. 6.4.1 Avoiding state
                  2. 6.4.2 Microservice architectures
                  3. 6.4.3 Background tasks
                  1. 7.1 Internal services
                    1. 7.1.1 Kubernetes cluster networking
                    2. 7.1.2 Creating an internal service
                    3. 7.1.3 Service discovery
                    1. 7.2.1 Securing connections with TLS
                    1. 8.1 Node feature selection
                      1. 8.1.1 Node selectors
                      2. 8.1.2 Node affinity and anti-affinity
                      3. 8.1.3 Tainting nodes to prevent scheduling by default
                      4. 8.1.4 Workload separation
                      1. 8.2.1 Building highly available deployments
                      2. 8.2.2 Co-locating interdependent Pods
                      3. 8.2.3 Avoiding certain Pods
                      1. 8.3.1 Placement rules don’t appear to work
                      2. 8.3.2 Pods are pending
                      1. 9.1 Volumes, persistent volumes, claims, and storage classes
                        1. 9.1.1 Volumes
                        2. 9.1.2 Persistent volumes and claims
                        3. 9.1.3 Storage classes
                        4. 9.1.4 Single-Pod stateful workload deployments
                        1. 9.2.1 Deploying StatefulSet
                        2. 9.2.2 Deploying a multirole StatefulSet
                        1. 10.1 Background processing queues
                          1. 10.1.1 Creating a custom task queue
                          2. 10.1.2 Signal handling in worker Pods
                          3. 10.1.3 Scaling worker Pods
                          4. 10.1.4 Open source task queues
                          1. 10.2.1 Running one-off tasks with Jobs
                          2. 10.2.2 Scheduling tasks with CronJobs
                          1. 10.3.1 Dynamic queue processing with Jobs
                          2. 10.3.2 Static queue processing with Jobs
                          1. 11.1 Production and staging environments using namespaces
                            1. 11.1.1 Deploying to our new namespace
                            2. 11.1.2 Syncing mutations from the cluster
                            1. 11.3.1 Deployment pipelines
                            2. 11.3.2 Continuous deployment with Cloud Build
                            1. 11.4.1 String-based (password) secrets
                            2. 11.4.2 Base64 encoded secrets
                            3. 11.4.3 File-based secrets
                            4. 11.4.4 Secrets and GitOps
                            1. 12.1 Staying up to date
                              1. 12.1.1 Cluster and node updates
                              2. 12.1.2 Updating containers
                              3. 12.1.3 Handling disruptions
                              1. 12.5.1 Pod Security admission
                              2. 12.5.2 Balancing security with compatibility
                              1. 12.7.1 Network policies
                              2. 12.7.2 Container isolation
                              3. 12.7.3 Cluster hardening
                              Show and hide more

                              Product information

                              • Title: Kubernetes for Developers
                              • Author(s): William Denniss
                              • Release date: March 2024
                              • Publisher(s): Manning Publications
                              • ISBN: 9781617297175