I need a Kubernetes operator that helps teams track and enforce monthly dollar budgets for LLM spend. I want to define a custom resource where I set a monthly spending limit in USD, a warning percentage threshold, and a reference to a ConfigMap where our cost tracking pipeline writes the observed total spend.
The operator should continuously monitor both the budget resource and its referenced ConfigMap. Whenever the spend value changes, it should calculate the current usage percentage and update the status to UnderBudget, Warning, or OverBudget. If the ConfigMap is missing or contains invalid data, set the status state to Unknown.
When spend crosses the warning threshold or goes over budget, emit Kubernetes events to notify the team. Build this in Go using controller runtime, separate the budget evaluation logic so it can be tested without a real cluster, and include fake client integration tests. Also provide a Dockerfile, Helm chart, and sample custom resource manifests for easy deployment.