Repository navigation
feat: Add generic CRD topology support via owner references - #56
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Key Changes
Backend:
internal/topology/builder.go: AddedaddGenericCRDNodes()andextractGenericStatus()for generic CRD supportinternal/k8s/dynamic_cache.go: CRD discovery with status tracking (idle → discovering → ready)internal/topology/types.go: AddedIncludeGenericCRDsbuild option andCRDDiscoveryStatusto topologyFrontend:
web/src/App.tsx: Loading indicator during CRD discovery, faster polling while discoveringweb/src/components/topology/TopologyFilterSidebar.tsx: Dynamic "Custom Resources" categoryweb/src/components/topology/K8sResourceNode.tsx: Default dimensions for unknown kindsweb/src/index.css: Default styling for unknown CRD iconsCloses #54