Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 2, 2026. Learn more…

Leanpub Header

Skip to main content

Build Kubernetes Operators with Kubebuilder

A Complete Guide to Creating, Testing, and Publishing Custom Controllers

Learn how to build Kubernetes Operators from scratch using Kubebuilder, step by step. You will create real controllers, work with CRDs, and understand how reconciliation works in practice. By the end, you’ll know how to design, test, and run your custom operator.

Minimum price

$15.00

$24.00

You pay

$24.00

Author earns

$19.20
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
About

About

About the Book

Build Kubernetes Operators with Kubebuilder

A Complete Guide to Creating, Testing, and Publishing Custom Controllers with Kubebuilder

Why Write a Kubernetes Operator?

Kubernetes covers common workloads well, but it can't anticipate every application-specific need. When you need to automate operational tasks that are unique to your environment, like cleaning up expired Jobs, enforcing company standards, integrating with internal systems — a custom Operator is the right tool.

Although ommunity operators exist, sometimes you only need a focused controller that does exactly one thing.

What You'll Learn

  • How Kubernetes extensibility works: CRDs, Custom Resources, and the control loop
  • When an Operator is the right solution — and when a Job or CronJob is enough
  • How to scaffold a production-ready Kubebuilder project from scratch
  • How to define a Custom Resource with validation markers, status fields, and finalizers
  • How to implement idempotent reconciliation logic safely
  • How to handle resource deletion using finalizers
  • How to expose and extend Prometheus metrics from your Operator
  • How to write unit tests and integration tests using Ginkgo, Gomega, and envtest
  • How to package your Operator as a Helm chart using the Kubebuilder Helm plugin
  • How to publish the chart via a GitHub release
  • How to add a new API version and support multiple versions using a CRD conversion webhook
  • How the Hub and Spoke pattern works in Kubebuilder and how to implement it

Who Is This Book For?

This book is for DevOps engineers and platform engineers who are already comfortable with Kubernetes and want to go beyond standard resources.

You'll get the most out of it if you:

  • Know Kubernetes fundamentals: Pods, Deployments, Services, and basic kubectl
  • Are comfortable with Go, or at least familiar with a statically-typed language like Java or C++
  • Have worked with YAML manifests and the command line
  • Want to build internal tooling or automation that community Operators don't cover

This is not a beginner's Kubernetes book. If you're new to Kubernetes, the foundational concepts are better covered in my ebook, Master Kubernetes from Scratch.

Why This Book

It walks through a complete, realistic Operator. Every chapter builds on the previous one. By the end, you have a working Operator with tests, metrics, multi-version API support, and a publishable Helm chart.

Bundle

Bundles that include this book

Author

About the Author

Kirshi Yin | Curious Devs Corner

I’m a backend developer with 8+ years of experience in Java, Spring Boot, Linux, and DevOps. I’ve published over 100 technical blog posts on medium.com. I spend my time learning modern technologies and turning that knowledge into clear, practical guides. I dedicate a lot of my time to learning and exploring new technologies. I love to spread knowledge about what I've learned. My goal is to help busy people improve their skills through focused, hands-on learning.

If you enjoy learning about modern technologies, check out my Medium/Substack publication called Curious Devs Corner which I created for curious developers like you.

Contents

Table of Contents

  • 1. Introduction to the Book
  • 2. Understanding Kubernetes Operators
  • 3. Getting Started with Kubebuilder
  • 4. Writing Your First Operator
  • 5. Testing Kubernetes Operators
  • 6. Monitoring Kubernetes Operators
  • 7. Distributing with Helm
  • 8. API Versioning
  • 9. Final Words

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub