-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
Product / Portfolio Work
-
False
-
-
False
-
3
-
None
-
None
-
NI&D Sprint 284
Description
Implement the foundational set of read-only NIDS diagnostic tools using native Go libraries (client-go). These tools provide safe, non-mutating inspection of Ingress and DNS resources on a live cluster. This execution replaces the previous CLI-wrapper approach with a robust, product-ready Go implementation.
Goals
- Create, or adopt, a Go-based MCP server skeleton.
- Implement inspection tools for Route, Service, Endpoints, and CoreDNS.
- Ensure strict read-only execution.
Tool Definitions
1. inspect_route
- Description: Retrieve the Route resource and attempt to inspect the associated Service and Endpoints to build a complete view of the ingress path.
- Input Schema:
{ "type": "object", "properties": { "namespace": { "type": "string", "description": "Route namespace" }, "name": { "type": "string", "description": "Route name" } }, "required": ["namespace", "name"] }
- Output Schema:
{ "route": { /* standard Route object */ }, "service": { /* standard Service object (spec) */ }, "endpoints": { /* standard Endpoints object (subsets) */ }, "error": "string (optional)" }
Implementation Steps
- If not adopting an existing MCP server project, initialize Go Project:
- Set up a new Go module/package for the NIDS tools.
- Import net/http (for MCP), k8s.io/client-go, and controller-runtime (optional, for client convenience).
- Implement inspect_route:
- Logic:
- Fetch Route object via K8s client.
- Extract spec.to.name (Service name).
- Fetch Service object.
- Fetch Endpoints object for that Service.
-
- Logic:
- Constraint Checklist:
- No usage of exec.Command("oc", ...) or exec.Command("dig", ...).
- Must use structured error handling.
Acceptance Criteria
- MCP tool inspect_route matches schema and returns Route+Service+Endpoints details.
- All implementation is native Go (no shell-outs).