Module 2: Introduction to Operators
Overview
Now that you understand Kubernetes architecture, the controller pattern, and Custom Resources (from Module 1), it’s time to build your first operator! This module introduces the operator pattern and teaches you how to use Kubebuilder to create operators that manage custom resources.
Duration: 5-6 hours
Prerequisites:
- Completion of Module 1: Kubernetes Architecture Deep Dive
- Basic Kubernetes knowledge
- Go programming fundamentals
Learning Objectives
By the end of this module, you will:
- Understand the operator pattern and when to use it
- Know how Kubebuilder works and its architecture
- Have a complete development environment set up
- Build and run your first “Hello World” operator
- Understand operator project structure
Module Structure
- Lesson 2.1: The Operator Pattern
- Lesson 2.2: Kubebuilder Fundamentals
- Lesson 2.3: Development Environment Setup
- Lesson 2.4: Your First Operator
Prerequisites Check
Before starting, ensure you’ve completed Module 1:
- ✅ Understand Kubernetes control plane components
- ✅ Know how the API machinery works
- ✅ Understand the controller pattern and reconciliation
- ✅ Can create and use Custom Resources (CRDs)
If you haven’t completed Module 1, start with Module 1: Kubernetes Architecture Deep Dive.
Setup
Before starting this module:
- Verify Module 1 completion:
- You should understand CRDs from Lesson 1.4
- You should understand controllers from Lesson 1.3
- Ensure development environment is ready:
./scripts/setup-dev-environment.sh - Have a kind cluster running:
./scripts/setup-kind-cluster.sh - Verify kubebuilder is installed:
kubebuilder version
Hands-on Labs
Each lesson includes hands-on exercises. All labs use the kind cluster and kubebuilder.
- Lab 2.1: Exploring Existing Operators
- Lab 2.2: Kubebuilder CLI and Project Structure
- Lab 2.3: Setting Up Your Environment
- Lab 2.4: Building Hello World Operator
What You’ll Build
By the end of this module, you’ll have:
- A complete “Hello World” operator that manages a custom resource
- Understanding of kubebuilder project structure
- Ability to run operators locally for development
- Foundation for building more complex operators in Module 3
Solutions
Complete working solutions for all labs are available in the solutions directory:
- Lab 2.4 Solutions - Complete Hello World operator (main.go, controller, types)