Skip to content

feat: Add generic CRD topology support via owner references - #56

Merged
nadaverell merged 1 commit into
mainfrom
feature/generic-crd-topology-support
Feb 1, 2026
Merged

nadaverell merged 1 commit into
mainfrom
feature/generic-crd-topology-support

Conversation

@nadaverell

@nadaverell nadaverell commented Feb 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds support for displaying ANY Kubernetes CRD type in the topology based on owner references, not just hardcoded types. Resources with owner refs pointing to existing topology nodes will automatically appear.

image
  • CRDs with owner references to existing topology nodes automatically appear
  • Health status extraction from common CRD patterns (conditions, phase fields)
  • Loading indicator shows "Discovering CRDs..." during API discovery
  • Dynamic filter sidebar includes discovered CRD kinds under "Custom Resources" category
  • Per-kind limit (50 nodes) prevents overwhelming the topology

Key Changes

Backend:

  • internal/topology/builder.go: Added addGenericCRDNodes() and extractGenericStatus() for generic CRD support
  • internal/k8s/dynamic_cache.go: CRD discovery with status tracking (idle → discovering → ready)
  • internal/topology/types.go: Added IncludeGenericCRDs build option and CRDDiscoveryStatus to topology

Frontend:

  • web/src/App.tsx: Loading indicator during CRD discovery, faster polling while discovering
  • web/src/components/topology/TopologyFilterSidebar.tsx: Dynamic "Custom Resources" category
  • web/src/components/topology/K8sResourceNode.tsx: Default dimensions for unknown kinds
  • web/src/index.css: Default styling for unknown CRD icons

Closes #54

Enable the topology to display ANY Kubernetes CRD type that has owner
references pointing to existing topology nodes, without hardcoding
specific CRD types.

Backend:
- Add `addGenericCRDNodes()` to builder.go that iterates watched CRDs
- Implement `extractGenericStatus()` for common CRD status patterns
- Add `IncludeGenericCRDs` option to BuildOptions (default: true)
- Limit 50 nodes per CRD kind to prevent overwhelming the graph
- Add CRD discovery system: discovers all watchable CRDs on first
  topology request and tracks discovery status (idle/discovering/ready)
- Return `crdDiscoveryStatus` in cluster-info API

Frontend:
- Make NodeKind type flexible to accept arbitrary CRD kind strings
- Add "Custom Resources" category to topology filter sidebar
- Dynamic CRD kinds appear with Puzzle icon fallback
- Fix "Show All" button to include dynamic CRD kinds
- Add default node dimensions for unknown CRD kinds
- Show "Discovering CRDs..." indicator in header during discovery
- Auto-refresh topology when CRD discovery completes

Also includes UI polish:
- Improved node border/shadow for better visual separation
- Fixed cursor behavior (grab/grabbing on pane, pointer on nodes)
- Refined group header scaling behavior
@nadaverell
nadaverell requested a review from hisco as a code owner February 1, 2026 21:53
@nadaverell
nadaverell merged commit 596902f into main Feb 1, 2026
6 checks passed
@nadaverell
nadaverell deleted the feature/generic-crd-topology-support branch February 6, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Topology for all k8s resources based on owner refs

1 participant