Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Michael Hausenblas, Stefan Schimanski

Rating No ratings yet

If you’re looking to develop native applications in Kubernetes, this is your guide. Developers and AppOps administrators will learn how to build Kubernetes-native applications that interact directly with the API server to query or update the state of resources. AWS developer advocate Michael Hausenblas and Red Hat principal software engineer Stefan Schimanski explain the characteristics of these apps and show you how to program Kubernetes to build them. You’ll explore the basic building blocks of Kubernetes, including the client-go API library and custom resources. All you need to get started is a rudimentary understanding of development and system administration tools and practices, such as package management, the Go programming language, and Git. • Walk through Kubernetes API basics and dive into the server’s inner structure • Explore Kubernetes’s programming interface in Go, including Kubernetes API objects • Learn about custom resources—the central extension tools used in the Kubernetes ecosystem • Use tags to control Kubernetes code generators for custom resources • Write custom controllers and operators and make them production ready • Extend the Kubernetes API surface by implementing a custom API server

AI Reading Assistant

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

AI guide
【One-Line Pitch】 A hands-on guide for developers who want to build applications that live *inside* Kubernetes—not just run on it—by speaking directly to the API server. Best for Go developers and AppOps admins ready to move past YAML and start writing controllers, operators, and custom resources. 【Book Arc】 - **Opening (~0%–10%)**: Frames what "programming Kubernetes" actually means—distinguishing cloud-native apps that are aware of and interact with the API server from off-the-shelf software merely deployed on a cluster. Sets scope, prerequisites (Go, Git, package management), and the extension points the book will cover. - **Early (~10%–30%)**: Introduces the Kubernetes API and its inner structure, then moves into the Go programming interface—client-go and API objects—as the foundation for everything that follows. A motivational "cloud-native at" example previews custom resources and controllers. - **Middle (~30%–55%)**: Explains controllers and operators in depth: the control loop (read state → change the world → update status), informers, work queues, watches, and the event-driven, edge-triggered architecture that makes Kubernetes scale. This is the conceptual core of the book. - **Late (~55%–85%)**: Shifts to custom resources as the central extension mechanism, including code generators and tags to control them, then builds toward writing custom controllers and operators and making them production-ready. - **Ending (~85%–100%)**: Extends the API surface itself by implementing a custom API server, rounding out the extension toolkit beyond CRDs and controllers. 【Key Takeaways】 - **"Programming Kubernetes" means writing apps that talk to the API server** (Early): the book draws a clear line between COTS/bespoke apps that ignore Kubernetes and cloud-native apps that query and update resource state—the latter gain portability and declarative control. - **Go is the default language for Kubernetes-native development** (Early): the authors justify this with a Unix/C analogy—Kubernetes and most cloud-native tooling are written in Go, so even non-Go developers benefit from reading it. - **The control loop is the universal pattern** (Middle): read resource state → change the world → update status, repeated forever. Every controller, however simple or complex, reduces to these three steps. - **Kubernetes is edge-driven, not level-driven** (Middle): event-based triggers via watches scale far better than polling, which is why informers and work queues exist—and why understanding watches matters for correct controllers. - **Informers and work queues are the practical machinery** (Middle): informers watch desired state and resync periodically to prevent drift; work queues handle retries and requeueing on errors. - **Custom resources are the central extension tool** (Late): CRDs let you define your own API objects, and code generators with tags automate the boilerplate—essential for anyone building operators. - **Operators encode operational knowledge** (Late): an operator is a controller plus custom resources that captures application lifecycle management, and the book emphasizes making them production-ready rather than demo-grade. - **You can extend the API surface itself** (Ending): implementing a custom API server goes beyond CRDs when you need deeper integration—the most advanced extension point covered. 【Reading Tips】 - **Deep-read the controller/control-loop chapters** (Middle): this is the conceptual hinge of the book; if you understand informers, work queues, and edge-vs-level triggers, the later operator material falls into place. - **Skim the front matter and prerequisites** (Opening): the setup, acknowledgments, and tooling notes are quick reads—confirm you have Go, Git, and a recent cluster (Minikube or kind) and move on. - **Have a cluster ready before the custom resource chapters**: the excerpts note that advanced CRD features and conversion require specific Kubernetes versions (1.13–1.15), so version mismatches will block hands-on practice. - **Treat the code examples as the real text**: the book ships manifests and scripts on GitHub; cloning the repos and running them chapter-by-chapter will teach you far more than reading alone. - **Don't skip the motivational example** (Early): the "cnat" custom resource + controller walkthrough is a miniature of the entire book's arc—return to it after finishing to see how much you've learned. 【Coverage Limits】 These excerpts cover the book's framing, prerequisites, controller/operator concepts, and extension-point overview, but do not include detailed chapter content on client-go APIs, code generator tags, or custom API server implementation. Specific code patterns and version-dependent features are only referenced, not shown.
Excerpt 1
h had existed when I started writing Kubernetes controllers. It serves the reader as a comprehensive deep dive into the Kubernetes programming interface and...
View in text
Excerpt 2
onal information. You can access this page at https://oreil.ly/pr-kubernetes . Email bookquestions@oreilly.com to comment or ask technical questions about th...
View in text
Excerpt 3
roller to execute the scheduled command at the correct time. In addition, a kubectl plug-in for the CLI UX would be useful, allowing simple handling via comm...
View in text
Excerpt 4
SEEN COUNT NAME KIND 3m 3m 1 kube-controller-manager-master.15932b6faba8e5ad Pod 3m 3m 1 kube-apiserver-master.15932b6fa3f3fbbc Pod 3m 3m 1 etcd-master.15932...
View in text
Excerpt 5
rgetPod . Name , rs , ); err != nil { podKey := controller . PodKey ( targetPod ) klog . V ( 2 ). Infof ( "Failed to delete %v, decrementing " + "expectation...
View in text
Excerpt 6
for cluster-internal communication, for performance reasons. The API server HTTP interface handles HTTP requests to query and manipulate Kubernetes resources...
View in text
Excerpt 7
p existed before the concept of an API group was introduced. There is a third type of HTTP paths—ones that are not resource aligned—that the API server expos...
View in text
Excerpt 8
ta1 scheduling.k8s.io/v1beta1 storage.k8s.io/v1 storage.k8s.io/v1beta1 v1 How the API Server Processes Requests Now that you have an understanding of the ext...
View in text
Tags
AI categories
Cloud NativeGoBackend
ISBN: 1492047104
Publisher: O’Reilly Media
Publish Year: 2019
Language: English
Pages: 272
File Format: EPUB
File Size: 4.6 MB