Repository navigation
Description
Is your task related to a problem? Please describe
When the user clicks on the 'Agent Space' button a dedicated namespace for Agents should be provisioned on the k8s level:
Describe the solution you'd like
Currently, each user is provisioned with a dedicated namespace once they enter user dashboard e.g. <username>-che.
For the Agent Space the dedicated namespace should be provisioned once the user either enters the space or more ideally, crafts a first Agent e.g.
<username>-che-agents
This agent namespace will have a different RBAC in comparison to the <username>-che namespace. Agents should not have the same privileges that developers have.
Implementation Details:
- For default dynamic provisioning, the agent namespace should be provisioned once a user either enters the Agent Space or crafts the first Agent
- If automatic namespace provisioning is disabled, agent namespaces must be pre-created by an admin (technically, the admin can control which users can / can not access Agent Spaces based on namespace pre-provisioning):
- if namespace is not pre-created, the error message is displayed on the UI - smth. like
You do not have access to the Agent Space - please contact admin. - Provisioning will probably stay in che-server, mirroring the existing flow for -che. The operator keeps doing what it already does well: reconciling cluster-scoped RBAC and syncing content into the namespace once it exists.
- Labels & annotations (must not collide with the
<username>-chenamespace)
Describe alternatives you've considered
Create Agents in the existing -che namespace, but this approach will be much less secure and convoluted
Additional context
Once this part is implemented, we should look into exposing dedicated Agent Preferences for Agents on UI for Agent Spaces that would be different from "User Preferences" for CDEs:

Activity
[-]As a user, I want to get dedicated namespace provisioned for Agents / Agent Space[/-][+]As a user, I want to have a dedicated namespace provisioned for the `Agent Space`[/+]