
- Surface findings from Kubernetes using an MCP-based endpoint for programmatic access (see MCP For Beginners).
- Use an LLM to analyze, classify, and enrich findings so they contain meaningful remediation and context.
- Orchestrate the end-to-end flow in a Python agent (LangChain) to translate raw data into tracker issues.
- Rules definition
- Tagging rules, patterns, and heuristics that classify findings (e.g., severity, component, owner).
- System prompt and instruction set
- A stable, structured system prompt that shapes the LLM’s behavior for issue creation and remediation suggestions.
- Orchestration (LangChain)
- LangChain acts as the orchestration layer: it sequences LLM calls, runs validation/parsing steps, and routes outputs to enrichment and posting components.
- Enrichment and structured output
- Convert noisy logs into structured objects with fields such as title, description, severity, remediation steps, and links to evidence.
- Issue creation
- Post the enriched findings to an issue tracker via MCP or your chosen ticketing API.
How the end-to-end flow runs
- Findings are emitted from Kubernetes (via MCP or another collector).
- The findings endpoint returns raw findings to the Python agent.
- The agent applies tagging rules to classify and prioritize each finding.
- The agent invokes the LLM using a stable system prompt to enrich the finding and produce structured output (title, description, severity, remediation).
- The structured output is validated, optionally routed through a human review step, then posted to the configured issue tracker.
- If classifications look wrong, update the tagging rules.
- If LLM output drifts, refine the system prompt or change the model.
- If issues fail to post, check the issue poster integration and API credentials.
We used the Claude Haiku model during this lesson. To switch models, update your model name in your environment configuration and restart the agent so the new model value is picked up by the running service.
.env entry (adjust the variable name to match your project):
- Swap the model: Test with alternative LLMs to compare cost, latency, and output quality. Update the
.envand run end-to-end tests. - Tune rules: Add or refine tagging rules to reduce false positives and to route issues to the right teams.
- Add observability: Log LLM prompts/responses (redact sensitive data), track ticket creation success/failure metrics.
- Human-in-the-loop: For high-severity issues, add an approval step before ticket creation.
- Integration choices: Connect to Jira, GitHub Issues, or other trackers via the issue poster component—ensure you store API tokens securely.
- MCP For Beginners: https://learn.kodekloud.com/user/courses/mcp-for-beginners
- LangChain course: https://learn.kodekloud.com/user/courses/langchain
- Kubernetes Basics: https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/