- Go 1.23+
- kubeconfig available locally for integration tests
- metrics-server recommended for
k8s.resource_usage
Run tests:
go test ./...
- Create a new folder under
toolsets/<toolset-id>. - Implement the toolset interface:
ID() string
Version() string
Init(ctx ToolsetContext) error
Register(reg Registry) error- Register tools with namespaced names (e.g.,
mytoolset.*). - Use shared libraries instead of duplicating logic:
internal/kubefor client creation and RESTMapper usage.internal/policyfor namespace/cluster enforcement.internal/evidencefor events, owner chains, endpoints, and pod status.internal/redactfor redaction.internal/renderfor consistent analysis output (userender.DescribeAnalysis).
- Update the Go input schemas in the toolset
schema.gofiles. - Add unit tests for safety mode behavior or shared helper usage.
- If your toolset should participate in graph-first flows, extend
k8s.debug_flowwith new nodes/steps. - For external toolsets, register via
pkg/sdkand document how to build a custom binary (seePLUGINS.md).
internal/kube: create typed/dynamic/discovery clients once and share across toolsets.internal/policy: enforce namespace restrictions and tool allowlists.internal/evidence: gather common evidence like events and owner references.internal/render: standardize output (root cause, evidence, next checks).internal/redact: token and secret redaction.
Use kind or minikube to validate:
k8s.*tools against core resources and CRDs.- Namespace vs cluster enforcement.
- Safety modes removing tools from discovery.
- Linkerd toolset (if installed) detects control-plane health.
- Karpenter toolset (if installed) diagnoses pending pods.
k8s.debug_flowwalks graph edges for traffic/pending/crashloop scenarios.