Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorBrendan Burns, Eddie Villalba, Dave Strebel, Lachlan Evenson

In this practical guide, four Kubernetes professionals with deep experience in distributed systems, enterprise application development, and open source will guide you through the process of building applications with this container orchestration system. They distill decades of experience from companies that are successfully running Kubernetes in production and provide concrete code examples to back the methods presented in this book. Revised to cover all the latest Kubernetes features, new tooling, and deprecations, this book is ideal for those who are familiar with basic Kubernetes concepts but want to get up to speed on the latest best practices. You'll learn exactly what you need to know to build your best app with Kubernetes the first time. • Set up and develop applications in Kubernetes • Learn patterns for monitoring, securing your systems, and managing upgrades, rollouts, and rollbacks • Integrate services and legacy applications and develop higher-level platforms on top of Kubernetes • Run machine learning workloads in Kubernetes Ensure Pod and container security • Understand issues that have become increasingly critical to the successful implementation of Kubernetes, such as chaos engineering/testing, GitOps, service mesh, and observability

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 This is a practical, field-tested playbook for developers and platform engineers who already know Kubernetes basics and want to build production-grade applications correctly the first time, covering everything from resource tuning and security to GitOps and machine learning workloads. 【Book Arc】 - **Opening (~0%–9%)**: Sets the stage by defining the book's audience—not beginners, but practitioners deploying real workloads—and outlines the full journey from basic service setup to advanced platform patterns. It establishes the core philosophy: Kubernetes is powerful but requires deliberate, correct usage. - **Early (~9%–25%)**: Walks through building a complete application from scratch, starting with a simple frontend Deployment. Key lessons include setting resource requests/limits (with practical advice on tuning for garbage-collected languages), adopting GitOps for source-control-to-cluster consistency, exposing services via Ingress, and handling the unique challenges of stateful applications like Redis. - **Early (~25%–34%)**: Shifts to developer workflows, covering the full onboarding lifecycle—from creating certificates and RBAC for new users to enabling testing and debugging. Highlights how IDE integrations (like the VS Code Kubernetes extension) make kubectl's power more accessible, reducing the learning curve for new team members. - **Middle (~34%–47%)**: Dives deep into observability, starting with a comprehensive monitoring strategy. Covers the core components to watch (API server, etcd, kubelet, etc.), introduces Prometheus as the primary metrics tool with its ecosystem (Operator, Node Exporter, kube-state-metrics, Alertmanager, Grafana), and discusses logging with Loki-Stack, including the trade-offs of self-hosted vs. hosted solutions. - **Late (~47%–100%)**: Expands into advanced and specialized topics, including managing stateful applications with PersistentVolumes, building higher-level platforms on top of Kubernetes (extending the API, cluster, and user experience), and running machine learning workloads with attention to storage, networking, and data scientist concerns. The book concludes with best practices for chaos engineering, GitOps, service mesh, and security. 【Key Takeaways】 - **Resource requests/limits are a stability lever, not just a quota** (Early): Setting requests equal to limits provides predictable scheduling and avoids oversubscription issues, even if it sacrifices some utilization. Start by overestimating and use monitoring to tune down, but expect needs to spike with first large-scale traffic. - **GitOps is the gold standard for cluster-source-of-truth** (Early): Deploying only from a specific branch via CI/CD ensures your cluster exactly matches source control. Even for simple apps, the automation is worth the setup cost, and retrofitting it later is extremely painful. - **Stateful apps require decoupling data from pods** (Early): Since pods can be rescheduled for upgrades or rebalancing, data stored locally will be lost. Use separate write/read services (e.g., a headless service for writes) and external storage to ensure persistence and transactional integrity. - **Onboarding should be measured with a KPI** (Early): Set a goal like "from zero to first deployment in minimal time" and use scripts to automate certificate generation and RBAC setup. This makes the process repeatable and reduces friction for new developers. - **IDE integration is the key to developer productivity** (Early): Tools like the VS Code Kubernetes extension turn complex kubectl commands into intuitive right-click actions (port-forward, logs, terminal), allowing developers with minimal Kubernetes experience to become productive quickly. - **Monitor the control plane, not just your apps** (Middle): A healthy cluster requires watching the API server, etcd, scheduler, and controller manager, alongside node components. Use cAdvisor (built into kubelet) for container metrics and consider a "utility cluster" for monitoring to avoid a production outage taking down your observability. - **Self-hosted logging gets complex as you scale** (Middle): Loki-Stack is a great starting point, but hosted solutions (Loki via Grafana, Datadog, etc.) offload operational cost. Evaluate business requirements before committing to self-hosting, as maintenance time grows disproportionately with environment size. 【Reading Tips】 - **Skim the early deployment chapters if you've built a service before** (Early): The core patterns (Deployment, Service, Ingress) are standard, but the resource tuning advice and GitOps rationale are worth a deep read. - **Deep-read the developer workflow chapter** (Early): The certificate/RBAC scripts and IDE integration tips are immediately actionable and will save you hours of manual setup. - **Use the monitoring chapter as a reference, not a tutorial** (Middle): The Prometheus architecture and Loki-Stack setup are well-covered, but the key takeaway is the component list and the "utility cluster" best practice. - **Pay special attention to the stateful applications chapter** (Late): The distinction between write and read services is a subtle but critical pattern for production databases. - **The final chapters are for platform builders** (Late): If you're not building higher-level abstractions or running ML workloads, skim these to understand what's possible, but don't get bogged down in the details. 【Coverage Limits】 The excerpts primarily cover the first half of the book (setup, workflows, monitoring). Detailed content on security, chaos engineering, service mesh, and machine learning is mentioned in the table of contents but not fully represented in the sample.
Excerpt 1
ween O’Reilly and Microsoft. See our statement of editorial independence. 978-1-098-14216-2 [LSI] Exporting Services by Using Internal Load Balancers 184 Exp...
View in text
Excerpt 2
seem excessive for a simple application, the automation by itself, independent of the reliability it provides, is usually worth the time taken to set it up....
View in text
Excerpt 3
there are problems, debug any issues with the application. This can also be a hurdle when developing in Kubernetes because it is not always clear how to inte...
View in text
Excerpt 4
into the pod. There are two main ways to do this: mounting every key/value pair in the ConfigMap as a series of environment variables into the pod using envF...
View in text
Excerpt 5
commands: - cd frontend - npm i redis --save When the build completes, you’ll want to test it, so we include a test step, which will run npm against the newl...
View in text
Excerpt 6
ht need to make architectural changes to make this possible. You might need to add automation so that humans aren’t cutting and pasting commands. Regardless...
View in text
Excerpt 7
ation to enable a pseudo–Layer 4 load balancer on each node. Figure 9-3 is a visual representation of how the service is tied to the pods via label selectors...
View in text
Excerpt 8
You can do this in your namespace YAML by adding labels as shown in the following example. We will start with a configuration that simply audits existing usa...
View in text
Tags
AI categories
Cloud NativeDevOpsBackend
ISBN: 1098142160
Publisher: O'Reilly Media
Publish Year: 2023
Language: English
Pages: 325
File Format: PDF
File Size: 5.6 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…