Add TNF two-node fencing diagnostics toolset #367
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.57) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 604 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.383
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #367"
general
weight: 0.35
dhensel-rh
Summary
Extends the OpenShift MCP server with a new
tnftoolset that brings two-node fencing (TNF) diagnostics into the MCP tool/prompt/resource model. TNF clusters rely on out-of-band STONITH fencing to prevent split-brain, but diagnosing fencing failures today requires manually cross-referencing Kubernetes node health, BMC credentials, hardware state, and RHEL HA fencing agent configuration — this toolset correlates all of those into conversational diagnostics that surface split-brain risks before they become outages.Ref: OCPEDGE-2742
Scope
This toolset is diagnostic-only. It collects and reports cluster state — it does
not modify fencing configuration, trigger remediation, or alter any cluster resources.
The one caveat:
tnf_check_stonith_statuscreates a temporary privileged debug podon a control-plane node to run
pcs status. This follows the same pattern ascluster-diagnostics/nodesdebug— it's a read mechanism, not a write operationagainst fencing config. Cleanup is handled by the
nodesdebugpackage's deferredteardown; verify behavior on abnormal exit (process crash, client disconnect) if
cleanup guarantees are important for review.
Future work may add remediation actions (e.g., restarting a fencing agent, unfencing
a node), but those would be a separate toolset or an explicit opt-in — not added to
these diagnostic tools.
What's included
Tools
tnf_check_fencing_config— validates fencing configuration including BareMetalHost resources, BMC credentials, cluster operator health, machine/node/BMH correlation, FenceAgentsRemediation templates, and NodeHealthCheck configtnf_check_stonith_status— creates a temporary privileged debug pod on a control-plane node (vianodesdebug) to runpcsdiagnostic commands. Returns pacemaker cluster state, STONITH device configuration, quorum status, and fencing history. The debug pod is automatically cleaned up after execution.Prompts
tnf-troubleshoot— comprehensive fencing troubleshooting guide that collects cluster topology, node health, operator status, BMH state, remediation config, and STONITH diagnostics. Includes API-down detection: when the cluster API is unreachable, returns an out-of-band recovery guide with BMC/IPMI procedures instead of failing.Resources
tnf://domain-knowledge/fencing— static reference for two-node fencing domain knowledge: corosync/pacemaker quorum rules, split-brain risk assessment matrix, and common recovery procedures. Extracted from the prompt to keep responses focused while making domain knowledge available on demand.Design notes
tnf_check_stonith_statuscreates a temporary debug pod (same pattern ascluster-diagnostics/nodesdebug), but does not modify user-visible cluster state.CoreV1Interfaceimplementations (interface embedding) instead ofk8s.io/client-go/kubernetes/fake, avoiding ~280 vendored files that would otherwise bloat the PR.Test plan
go build ./...passesgo vet ./pkg/toolsets/tnf/...passesgo test ./pkg/toolsets/tnf/...passes (tnf + fencing packages)go test ./pkg/toolsets/...passes (includes global resource URI uniqueness checks)find vendor -path '/kubernetes/fake' | wc -lreturns 0🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Added TNF (Two-Node Fencing) diagnostics for fencing health and STONITH status, plus a full
tnf-troubleshootwalkthrough prompt.Included TNF domain-knowledge content with step-by-step recovery guidance and structured Markdown output.
Bug Fixes
Enhanced behavior and messaging when the Kubernetes API is unreachable.
Added stronger input validation and clearer reporting when expected cluster data isn’t available.
Documentation
Added a TNF toolset guide page covering tools, arguments, outputs, and prerequisites.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->