# Kubernetes Learning Path

## Welcome to Kubernetes
Your guide to understanding the codebase

### Learning Units
- **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

### 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-111`: Examine how Kubernetes organizes API groups and resources in the discovery document.
- `Makefile:1-50`: Study the build targets and code generation commands.
- `CHANGELOG.md:1-37`: Review recent changes to understand the contribution workflow.
- `staging/src/k8s.io/api/core/v1/types.go`: Look at how core API types like Pod and ResourceQuota are defined.
- `staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/`: Explore the webhook admission plugin implementation.
- `staging/src/k8s.io/sample-controller/`: Study the controller pattern, informers, and workqueue usage.
- `pkg/controller/`: Implement your quota controller logic here.
- `staging/src/k8s.io/api/`: Add your new API group and version here.

### Success Criteria
- Custom ResourceQuota API type is defined with proper versioning (v1alpha1).
- 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`

### Prerequisites
- Go programming fundamentals.
- Kubernetes API concepts (resources, controllers, admission control).
- Understanding of informers and workqueues.
- Basic webhook concepts.
