k8s-controller-testing

Test Kubernetes controllers with envtest, CEL validation, and goroutine-leak checks.

3|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/missBerg/envoy-skills --skill k8s-controller-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: k8s-controller-testing
Source: https://github.com/missBerg/envoy-skills/tree/main/shared/contributors/skills/k8s-controller-testing
Command: npx skills add https://github.com/missBerg/envoy-skills --skill k8s-controller-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kubernetes controllers require reliable testing to catch integration issues early and prevent regressions.

Core Features & Use Cases

  • Envtest-based reconciliation tests that exercise the API server and admission behavior
  • CEL validation testing to ensure CRD constraints are enforced
  • Async reconciliation and finalizer testing to verify expected lifecycle handling
  • Goroutine leak detection to prevent resource leaks in long-running controllers

Quick Start

Run a comprehensive test suite for Kubernetes controllers using envtest, CEL validation, and goroutine-leak checks.

Frequently Asked Questions about k8s-controller-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Kubernetes controller reconciliation using envtest?

Envtest provides a real API server for Kubernetes controller testing, allowing you to exercise reconciliation loops and admission behavior. It supports standard Go tests to verify expected lifecycle handling and status conditions end-to-end.

What is the best way to validate CRD constraints with CEL in Go tests?

CEL validation testing ensures CRD constraints are enforced by the API server. By running envtest, you can verify that your custom resource definitions reject invalid configurations and admit valid ones during controller integration tests.

How do I detect goroutine leaks in long-running Kubernetes controllers?

Goroutine leak detection prevents resource leaks in long-running controllers. By integrating goleak checks into your standard Go tests, you can identify unreleased goroutines across unit, integration, and data-plane scenarios during test cleanup.

Can I test async finalizers and status conditions in Kubernetes controllers?

Yes, you can test async finalizers and status conditions. Envtest environments support verifying expected lifecycle handling, ensuring your controller correctly manages finalizer deletion and updates status conditions during asynchronous reconciliation.

Does envtest work with standard Go tests for Kubernetes controller workflows?

Envtest works seamlessly with standard Go tests for Kubernetes controller workflows. It provides structured testing strategies for end-to-end reconciliation, allowing you to organize tests, manage cleanup, and detect leaks without requiring a full cluster.