Skip to content

Conversation

@rishabh998186
Copy link
Contributor

@rishabh998186 rishabh998186 commented Oct 1, 2025

While using Kagent, I noticed that although Kagent was installed correctly in the kagent namespace and my CLI config had the correct namespace set, running kagent dashboard showed the namespace dropdown as empty and the dashboard failed to display agents and models.

Root Cause
After investigation, the issue boiled down to two key problems:

CLI Configuration Initialization
The CLI code was not loading the configuration file (~/.kagent/config.yaml) before parsing command-line flags. This caused it to ignore the configured namespace and other settings, leading to the dashboard commands querying the wrong or no namespace, resulting in empty namespace displays.

UI Backend Connectivity and DNS Resolution
The dashboard UI tried to talk to the backend controller using the controller’s full DNS name (e.g., kagent-controller.kagent.svc.cluster.local). However, DNS resolution for this full name failed inside the UI container due to cluster DNS issues, causing errors when fetching models and agents, and resulting in HTTP 500 errors on the UI side.

Changes Made
To fix these issues, I made the following changes:

Fix CLI Config Loading Order
Modified the CLI’s main function to initialize the config file before processing CLI flags. This ensures the CLI properly respects the namespace and all other user-configured settings.

Update Helm UI Deployment Template
Changed the UI’s backend URL environment variable in the Helm chart from using the full DNS name to using the short Kubernetes service name (kagent-controller).
This leverages Kubernetes’ built-in DNS search domains that reliably resolve short names within the same namespace, avoiding DNS resolution failures.

Impact
These fixes make sure the dashboard properly displays the configured namespace, and the UI correctly fetches and displays agents and models without errors or empty

Screenshot from 2025-10-01 23-57-28

If the namespace were empty or not being read correctly, you would see a blank dashboard with no agents or models listed.

rishabh998186 added 2 commits October 1, 2025 18:10
Signed-off-by: rishabh998186 <rishabh998186@gmail.com.com>
Signed-off-by: rishabh998186 <rishabh998186@gmail.com.com>
@rishabh998186 rishabh998186 deleted the fix/dashboard-namespace-empty branch October 3, 2025 10:37
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.

1 participant