Module 8: Advanced Topics and Real-World Patterns
Overview
Congratulations on reaching the final module! Now that you can build production-ready operators (Module 7), it’s time to explore advanced topics and real-world patterns. This module covers multi-tenancy, operator composition, stateful application management, and best practices from popular operators.
Duration: 6-7 hours
Prerequisites:
- Completion of all previous modules (Modules 1-7)
- Production-ready operator from Module 7
- Understanding of advanced Kubernetes concepts
Learning Objectives
By the end of this module, you will:
- Build cluster-scoped and multi-tenant operators
- Compose multiple operators together
- Manage stateful applications with backups and migrations
- Understand real-world operator patterns
- Apply best practices from popular operators
Module Structure
- Lesson 8.1: Multi-Tenancy and Namespace Isolation
- Lesson 8.2: Operator Composition
- Lesson 8.3: Stateful Application Management
- Lesson 8.4: Real-World Patterns and Best Practices
Prerequisites Check
Before starting, ensure you’ve completed:
- ✅ Module 7: Production-ready operator
- ✅ Have a working operator with all features
- ✅ Understand production deployment
- ✅ Ready for advanced topics
If you haven’t completed Module 7, start with Module 7: Production Considerations.
What You’ll Build
Throughout this module, you’ll extend your Database operator with:
- A new cluster-scoped ClusterDatabase API for multi-tenant support
- Backup and restore functionality
- Advanced stateful application patterns
- Real-world best practices
Setup
Before starting this module:
- Have your production-ready operator from Module 7:
- Should be packaged and deployed
- Should have HA and security configured
- Ready for advanced features
- Ensure development environment is ready:
./scripts/setup-dev-environment.sh - Have a kind cluster running:
./scripts/setup-kind-cluster.sh
Hands-on Labs
Each lesson includes hands-on exercises that add advanced features to your operator.
- Lab 8.1: Building Multi-Tenant Operator
- Lab 8.2: Composing Operators
- Lab 8.3: Managing Stateful Applications
- Lab 8.4: Final Project
Solutions
Complete working solutions for all labs are available in the solutions directory:
Lab 8.1 Solutions - Multi-Tenant Operator
- clusterdatabase-types.go - ClusterDatabase API type definitions
- clusterdatabase-controller.go - ClusterDatabase controller implementation
- multi-tenant-controller.go - Multi-tenant patterns and helpers
Lab 8.2 Solutions - Operator Composition
- backup-operator.go - Complete backup operator
- operator-coordination.go - Operator coordination examples
Lab 8.3 Solutions - Stateful Application Management
- backup.go - Backup functionality implementation
- restore.go - Restore functionality implementation
- rolling-update.go - Rolling update handling
Lab 8.4 Solutions - Final Project
- See solutions README for complete examples