Testing Kubernetes CRDs
summary
Practical checklist for CRD testing: use client-go fakes or the kubebuilder generated test harness to run integration tests without a real cluster, run a few end-to-end tests against a real cluster (use go build tags to exclude slow e2e), create a namespace per test and catch interrupts for cleanup, poll with pollImmediate for eventual consistency, aim for about 80% coverage, factor business logic into a functional core and keep controller code as an imperative shell so most behavior is unit-testable.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:01Platforms and CRDs
- 2:59The testing pyramid
- 3:43End-to-end testing
- 10:02Integration testing
- 14:26Unit testing
- 18:40Summary and takeaways
- 19:08Q&A session
related talks
26mContinuous Integration Testing
26mThe Hitchhiker's Guide to Testing Kubernetes
24mWhy Kubernetes Applications Require a New Approach to Testing using Testkube
35mIntro: Testing SIG
31mContinuous Integration Testing
32mTestable Kubernetes Operators
32mUsing kubectl to Run your End-to-End Tests
05mLightning Talk: Unit Testing in Go With K8s Clients & APIs: An Intern’s POV on Why I...
