- collect Deployments from a Kubernetes cluster,
- evaluate resources against FinOps tagging rules,
- and create issues in the issue tracker for non-compliant resources.
- Ensure your Kubernetes MCP(s) and the issue tracker service are running and reachable (Uvicorn endpoints for the tracker).
- Confirm the tracker currently has no tickets before starting.
Ensure your MCP servers and issue tracker container are running (Uvicorn / MCP endpoints reachable) before running the audit agent. If the tracker or MCP is down, the agent cannot create tickets.
streamable_http.
MCP server “tracker” is using SSE transport (deprecated). Consider migrating to
streamable_http to avoid future incompatibilities.kubectl_get call scoped to the payment namespace, then evaluated labeling compliance and created tickets.
Example agent actions (condensed):
- Request Deployments (single kubectl_get):
- Create issues on the tracker MCP (example payload):
payment namespace):
- Step 1 – Collected Deployments in
payment: 3 foundpayment-gatewaypayment-gateway-apipayment-processor
- Step 2 – Evaluated each Deployment against the FinOps tagging policy. None of the three contained a
labelsfield, so required tags (owner, environment, cost-center, application, tier, slack-channel) could not be matched — all three were non-compliant. - Step 3 – Created 3 tickets (category:
missing-labels, priority:high), one per Deployment:- FINOPS-0001 – payment/payment-gateway
- FINOPS-0002 – payment/payment-gateway-api
- FINOPS-0003 – payment/payment-processor
Each ticket suggested
payment-teamas owner andpaymentas cost-center based on namespace context.
- Step 4 – Confirmed via
list_issues: 3 total issues, all inbacklog, 0 estimated monthly savings recorded.
Why the agent only evaluated the
payment namespace
Open the Python auditor file and inspect the prompt and allowed tools. The PROMPT explicitly constrained the collection to a single kubectl_get against namespace=payment. The agent follows the prompt literally and therefore limited its scope accordingly.
Relevant excerpt from the Python auditor (kept concise):
kubectl_get, update Step 1 in the PROMPT to request all namespaces (e.g., set allNamespaces=True or remove the namespace constraint so the tool uses allNamespaces=True).
Example conceptual change:
- Step 1 – Collected: 9 Deployments across all namespaces via one
kubectl_getcall. - Step 2 – Evaluated against tagging rules: 2 Deployments were excluded by
excluded_namespaces(e.g.,kube-systemandlocal-path-storage); the remaining 7 had zero labels and were non-compliant. - Step 3 – Created 7 new tickets (in addition to the 3 pre-existing payment tickets from the prior run):
- FINOPS-0004 — booking-api/booking-api — missing-labels — high
- FINOPS-0005 — default/analytics-collector — missing-labels — low
- FINOPS-0006 — flight-search/flight-search-service — missing-labels — medium
- FINOPS-0007 — inventory/inventory-service — missing-labels — medium
- FINOPS-0008 — payment/payment-gateway — missing-labels — critical
- FINOPS-0009 — payment/payment-gateway-api — missing-labels — critical
- FINOPS-0010 — payment/payment-processor — missing-labels — critical
- Step 4 –
list_issuesconfirmed: 10 total open tickets in backlog (0 in progress/done), allmissing-labels.
payment-gateway-api) may appear duplicated across runs with slightly different metadata. Add deduplication logic in the tracker integration or agent to avoid duplicate tickets for the same resource.
Next steps and operational notes
- Triage: Engineering teams can triage issues, assign owners, estimate savings, and progress tickets (backlog → in-progress → done).
- Remediation: Applying the required labels to Deployments resolves FinOps issues and enables cost attribution.
- Automation: Consider deduplication, severity heuristics, and automatic reassignment rules in the tracker integration to reduce noise.
- Architecture: Update your documentation to reflect the actual flow used here — collector agent → Kubernetes MCP(s) → LLM-based evaluation using tagging rules → issue tracker MCP → ticket board.
- Kubernetes Basics
- Uvicorn ASGI server
- MCP / mcp_client: refer to your project’s MCP documentation or the repository that provides
mcp_client.