Skip to content

Conversation

Prateekbala
Copy link

This PR implements configurable namespace filtering for standalone Models Web App deployments, addressing issue #43. Users can now control which namespaces are available in the namespace selector through an environment variable.

Changes Made

Backend
New API endpoint: Added /api/namespaces endpoint in get.py
Environment variable support: Implements ALLOWED_NAMESPACES configuration
Filtering logic: Parses comma-separated namespace list and validates against existing Kubernetes namespaces
Error handling: Falls back to all namespaces if specified ones don't exist

Frontend
New service: Created MWANamespaceService to handle filtered namespace logic
Custom component: Implemented NamespaceSelectComponent that conditionally shows/hides the dropdown
Auto-selection: Single namespace is automatically selected when only one is configured
UI integration: Updated index component to use the new namespace selector

Documentation
README updates: Added environment variable documentation and usage examples

Configuration
The feature is controlled by the ALLOWED_NAMESPACES environment variable:
Empty/unset: Default behavior - shows all namespaces.
Single namespace: ALLOWED_NAMESPACES="kubeflow-user" - auto-selects and hides dropdown.
Multiple namespaces: ALLOWED_NAMESPACES="ns1,ns2,ns3" - shows filtered dropdown.

Behavior
Default mode: When ALLOWED_NAMESPACES is not set, all namespaces are shown (backward compatible)
Single namespace mode: Dropdown is hidden and namespace is auto-selected.
Multi-namespace mode: Dropdown shows only specified namespaces.
Error resilience: Falls back to all namespaces if configuration is invalid.

Backward Compatibility
This change is fully backward compatible:
Existing deployments continue to work without any configuration changes.
No breaking changes to existing APIs or components.
Default behavior remains unchanged when environment variable is not set.

Resolves
Closes #43

@LogicalGuy77
Copy link
Contributor

@juliusvonkohout please approve the workflows, @Prateekbala thank you for your contribution

@juliusvonkohout
Copy link
Contributor

@juliusvonkohout please approve the workflows, @Prateekbala thank you for your contribution

@LogicalGuy77 Yes, but please focus primarily on the tests in kubeflow/manifests

@juliusvonkohout
Copy link
Contributor

@Griffin-Sullivan for review

@LogicalGuy77
Copy link
Contributor

@LogicalGuy77 Yes, but please focus primarily on the tests in kubeflow/manifests

yes working on manifests currently, my colleague wanted to get into open source so pointed him towards this issue.

@juliusvonkohout
Copy link
Contributor

juliusvonkohout commented Oct 1, 2025

@LogicalGuy77 Yes, but please focus primarily on the tests in kubeflow/manifests

yes working on manifests currently, my colleague wanted to get into open source so pointed him towards this issue.

What a wonderful idea :-) There will be GSOC 2026 ;-)

@Prateekbala
Copy link
Author

Hi , I’ve fixed the formatting issues and committed the changes. The workflow checks are now pending and require approval—could you please review and approve them? Thanks!

@juliusvonkohout
Copy link
Contributor

Hi , I’ve fixed the formatting issues and committed the changes. The workflow checks are now pending and require approval—could you please review and approve them? Thanks!

There are some errors, for example here https://github.com/kserve/models-web-app/actions/runs/18170289667/job/51992626737?pr=136. You can also run these tests locally.

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.

Configurable namespaces for standalone version

3 participants