k8s-controller-perf
Installation
SKILL.md
Controller Performance
Performance tuning patterns for Kubernetes controllers. Covers field indexers for O(1) lookups, predicate filters to reduce reconciliation noise, cache optimization, work queue tuning, and observability.
Field Indexers
Why Indexers Matter
Without indexes, finding all resources that reference a Secret requires listing ALL resources and filtering client-side. With an index, the API server does an O(1) lookup.
// WITHOUT index — O(n) list + filter
var allRoutes myv1.MyRouteList
_ = client.List(ctx, &allRoutes)
for _, route := range allRoutes.Items {
if route.Spec.SecretRef.Name == secretName {
// found it
}
}