Kubernetes
Welcome to Kubernetes
Your guide to understanding the codebase.
Learning Path
- 14 units • 4 levels
Orchestration & APIs (3 units)
- Kubernetes API Fundamentals
- API Group Organization and Versioning
- API Machinery and Resource Lifecycle
Core Logic & Data (3 units)
- Workload and Scheduling APIs
- Networking and Storage Infrastructure
- Security and Access Control
Interaction & Integration (3 units)
- API Extensions and Aggregation
- OpenAPI Specification Organization
- Admission Control and Webhooks
Cross-Cutting Concerns (2 units)
- Events and Observability
- Development Tooling and Contribution
Test Your Knowledge
Test your deep understanding of the codebase.
Question Tiers
- Why
- Purpose & Problem
- Design & Patterns
- Implementation
Hands-On Assignment
Your Challenge
Implement a custom API resource called 'ResourceQuota' that tracks and limits the number of Pods a namespace can create. Your implementation should include a new API type with proper versioning (v1alpha1), a custom controller that watches Pod creation events, and an admission webhook that validates Pod creation requests against the quota limits. The quota should be configurable per namespace and persist its state.
Starting Points
api/discovery/aggregated_v2.json:1-111Makefile:1-50CHANGELOG.md:1-37staging/src/k8s.io/api/core/v1/types.gostaging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/staging/src/k8s.io/sample-controller/pkg/controller/staging/src/k8s.io/api/
Success Criteria
- Custom ResourceQuota API type is defined with proper versioning (v1alpha1) and includes Spec and Status fields.
- Code generation completes successfully and produces clientset, listers, and informers for your new type.
- Controller successfully watches Pod events and updates ResourceQuota status with current pod count.
- Admission webhook denies Pod creation when namespace quota would be exceeded.
- ResourceQuota can be created, updated, and deleted using kubectl.
- Status field accurately reflects current usage vs. limits in real-time.
- Existing Kubernetes tests still pass: make test.
Hints
- Understanding API Machinery concept.
- API Type Structure implementation.
- Controller Implementation Pattern implementation.
- Admission Webhook Integration implementation.
- Code Generation code location.
- Testing Your Implementation implementation.
Prerequisites
- Go programming fundamentals
- Kubernetes API concepts (resources, controllers, admission control)
- Understanding of informers and workqueues
- Basic webhook concepts.