Book description
Kubernetes is the de facto standard for container orchestration and distributed applications management across a microservices framework. With this practical cookbook, you'll learn hands-on Kubernetes recipes for automating the deployment, scaling, and operations of application containers across clusters of hosts.
In this fully updated second edition, Sameer Naik, Sébastien Goasguen, and Jonathan Michaux from TriggerMesh provide a problem-solution-discussion format with easy lookups to help you find the detailed answers you need—fast. Kubernetes lets you deploy your applications quickly and predictably, so you can efficiently respond to customer demand. This cookbook delivers the essential knowledge that developers and system administrators need to get there.
Recipes in this cookbook focus on:
- Creating a Kubernetes cluster
- Using the Kubernetes command-line interface
- Managing fundamental workload types
- Working with services
- Exploring the Kubernetes API
- Managing stateful and non-cloud-native apps
- Working with volumes and configuration data
- Cluster-level and application-level scaling
- Securing your applications
- Monitoring and logging
- Maintenance and troubleshooting
Publisher resources
Table of contents
- Preface
-
1. Getting Started with Kubernetes
- 1.1. Installing the Kubernetes CLI, kubectl
- 1.2. Installing Minikube to Run a Local Kubernetes Instance
- 1.3. Using Minikube Locally for Development
- 1.4. Starting Your First Application on Minikube
- 1.5. Using kind to Run Kubernetes Locally
- 1.6. Using Kubernetes in Docker Desktop
- 1.7. Switching kubectl Contexts
- 1.8. Switching Contexts and Namespaces Using kubectx and kubens
-
2. Creating a Kubernetes Cluster
- 2.1. Preparing a New Node for a Kubernetes Cluster
- 2.2. Bootstrapping a Kubernetes Control-Plane Node
- 2.3. Installing a Container Network Add-on for Cluster Networking
- 2.4. Adding Worker Nodes to a Kubernetes Cluster
- 2.5. Deploying the Kubernetes Dashboard
- 2.6. Accessing the Kubernetes Dashboard
- 2.7. Deploying the Kubernetes Metrics Server
- 2.8. Downloading a Kubernetes Release from GitHub
- 2.9. Downloading Client and Server Binaries
- 2.10. Using systemd Unit Files for Running Kubernetes Components
- 2.11. Creating a Kubernetes Cluster on Google Kubernetes Engine
- 2.12. Creating a Kubernetes Cluster on Azure Kubernetes Service
- 2.13. Creating a Kubernetes Cluster on Amazon Elastic Kubernetes Service
- 3. Learning to Use the Kubernetes Client
-
4. Creating and Modifying Fundamental Workloads
- 4.1. Creating a Pod Using kubectl run
- 4.2. Creating a Deployment Using kubectl create
- 4.3. Creating Objects from File Manifests
- 4.4. Writing a Pod Manifest from Scratch
- 4.5. Launching a Deployment Using a Manifest
- 4.6. Updating a Deployment
- 4.7. Running a Batch Job
- 4.8. Running a Task on a Schedule Within a Pod
- 4.9. Running Infrastructure Daemons per Node
- 5. Working with Services
-
6. Managing Application Manifests
- 6.1. Installing Helm, the Kubernetes Package Manager
- 6.2. Adding Chart Repositories to Helm
- 6.3. Using Helm to Install Applications
- 6.4. Inspecting the Customizable Parameters of a Chart
- 6.5. Overriding Chart Parameters
- 6.6. Getting the User-Supplied Parameters of a Helm Release
- 6.7. Uninstalling Applications with Helm
- 6.8. Creating Your Own Chart to Package Your Application with Helm
- 6.9. Installing Kompose
- 6.10. Converting Your Docker Compose Files to Kubernetes Manifests
- 6.11. Converting Your Docker Compose File to a Helm Chart
- 6.12. Installing kapp
- 6.13. Deploying YAML Manifests Using kapp
- 7. Exploring the Kubernetes API and Key Metadata
-
8. Volumes and Configuration Data
- 8.1. Exchanging Data Between Containers via a Local Volume
- 8.2. Passing an API Access Key to a Pod Using a Secret
- 8.3. Providing Configuration Data to an Application
- 8.4. Using a Persistent Volume with Minikube
- 8.5. Understanding Data Persistency on Minikube
- 8.6. Storing Encrypted Secrets in Version Control
- 9. Scaling
- 10. Security
-
11. Monitoring and Logging
- 11.1. Accessing the Logs of a Container
- 11.2. Recovering from a Broken State with a Liveness Probe
- 11.3. Controlling Traffic Flow to a Pod Using a Readiness Probe
- 11.4. Protecting Slow-Starting Containers Using a Start-up Probe
- 11.5. Adding Liveness and Readiness Probes to Your Deployments
- 11.6. Accessing Kubernetes Metrics in the CLI
- 11.7. Using Prometheus and Grafana on Minikube
-
12. Maintenance and Troubleshooting
- 12.1. Enabling Autocomplete for kubectl
- 12.2. Removing a Pod from a Service
- 12.3. Accessing a ClusterIP Service Outside the Cluster
- 12.4. Understanding and Parsing Resource Statuses
- 12.5. Debugging Pods
- 12.6. Influencing a Pod’s Start-up Behavior
- 12.7. Getting a Detailed Snapshot of the Cluster State
- 12.8. Adding Kubernetes Worker Nodes
- 12.9. Draining Kubernetes Nodes for Maintenance
-
13. Service Meshes
- 13.1. Installing the Istio Service Mesh
- 13.2. Deploying a Microservice with an Istio Sidecar
- 13.3. Routing Traffic Using an Istio Virtual Service
- 13.4. Rewriting a URL Using an Istio Virtual Service
- 13.5. Installing the Linkerd Service Mesh
- 13.6. Deploying a Service into the Linkerd Mesh
- 13.7. Routing Traffic to a Service in Linkerd
- 13.8. Authorizing Traffic to the Server in Linkerd
-
14. Serverless and Event-Driven Applications
- 14.1. Installing the Knative Operator
- 14.2. Installing the Knative Serving Component
- 14.3. Installing the Knative CLI
- 14.4. Creating a Knative Service
- 14.5. Installing the Knative Eventing Component
- 14.6. Deploying a Knative Eventing Source
- 14.7. Enabling Knative Eventing Sources
- 14.8. Installing Event Sources from TriggerMesh
- 15. Extending Kubernetes
- Appendix. Resources
- Index
- About the Authors
Product information
- Title: Kubernetes Cookbook, 2nd Edition
- Author(s):
- Release date: November 2023
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781098142247
You might also like
book
Kubernetes Cookbook
Kubernetes is becoming the de-facto standard for container orchestration and distributed applications management across a microservices …
book
Kubernetes: Up and Running, 2nd Edition
Kubernetes radically changes the way applications are built and deployed in the cloud. Since its introduction …
video
Getting Started with Kubernetes LiveLessons, 2nd Edition
6+ Hours of Video Instruction An updated edition of this video title is available. Please go …
book
Kubernetes in Action
Kubernetes in Action is a comprehensive guide to effectively developing and running applications in a Kubernetes …