Display unmapped agents in Agent authorization UI
Issue: FE: Display unmapped agents in the group agents... (#444847 - closed)
What does this MR do and why?
NOTICE This feature is behind the remote_development_namespace_agent_authorization
feature flag.
It displays cluster agents that are mapped or unmapped to group to create Remote Development Workspaces in the Workspaces group settings page. This merge request is a follow-up to !152216 (merged) and introduces the following functionality:
- A tab navigation to switch between two views: "Allowed agents" and "All agents".
- The "Allowed agents" tab displays a table with agents mapped to a group.
- The "All agents" tab displays a table with all the group's cluster agents. It adds a 2nd column to the table that indicates the Agent's mapping status: Allowed or blocked.
Next steps
- FE: Allow users to map an available agent to a ... (#444857 - closed)
- FE: Allow users to unmap an available agent to ... (#444858 - closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Description | After |
---|---|
All agents tab with agents | |
Allowed agents tab with agents | |
Allowed agents tab with no agents | |
Either tab when there aren't agents | |
Mobile view | |
With loading error |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Enable the
remote_development_namespace_agent_authorization
feature flag:rails c && Feature.enable(:remote_development_namespace_agent_authorization)
-
Follow these instructions to register two cluster agents in the
gitlab-org
group:- Create a project in the group
gitlab-org
namedworkspaces-agents-config
. - Create two directories in the project's repository:
.gitlab/agents/remote-dev
.gitlab/agents/remote-dev-two
- Create a project in the group
-
In each directory, create a file named
config.yaml
with the following contentremote_development: enabled: true dns_zone: workspaces.localdev.me # below configuration is optional # they override the default values network_policy: enabled: true # if your GDK is configured on a public IP, you don't need to set the `egress` key in this section. egress: - allow: '0.0.0.0/0' except: - '10.0.0.0/8' - '172.16.0.0/12' - '192.168.0.0/16' # if your GDK is configured on a different private IP, use that in the line below. - allow: '172.16.123.1/32' # for debugging locally to increase log verbosity observability: logging: level: debug grpc_level: warn
-
To connect the cluster agents:
- In the
workspaces-agent-config
project, navigate to Operate -> Kubernetes Clusters. - Click the button "Connect to cluster" and select the "remote-dev" agent. Connect the cluster and close the modal dialog. It doesn't matter if the cluster is not connected.
- Repeat step 2 for the "remote-dev-two" agent.
- In the
-
To map one of the agents to the group, execute the following mutation in http://gdk.test:3000/-/graphql-explorer. You might need to adjust the ID number
mutation { namespaceCreateRemoteDevelopmentClusterAgentMapping(input:{ namespaceId: "gid://gitlab/Group/24", clusterAgentId: "gid://gitlab/Clusters::Agent/2" }) { clientMutationId } }
-
Open the URL http://gdk.test:3000/groups/gitlab-org/-/settings/workspaces
-
You should see the table populated with one allowed agent and two agents in the "All agents tab"