Draft: Workspace ports POC
Issue: Investigate exposing ports for workspaces (#501665 - closed)
What does this MR do and why?
WARNING: This is only a POC and should not be merged!
This merge request is a proof of concept that introduces a new feature, which allows users to create and manage ports for their remote development workspaces. It adds a new tab called "Workspace Ports" to the workspace details page, where users can view, open, and close ports for their workspaces. Additionally, it includes backend changes to support the creation and management of these ports, including database migrations and GraphQL mutations.
This lays the ground work needed on the rails application to handle exposing dynamic ports from within the workspace. It introduces:
- A new database table to store workspace ports data
- GraphQL mutations for creating/updating ports
- Domain logic for creating/updating a newly introduced [user provided] ports service definition that gets injected into the desired configuration for the reconcilliation of a workspace
- Introduces logic to trigger a reconcile loop when the create/update workspace ports GraphQL mutations are executed
Additional Notes:
- Service creation is handled by the k8s agent once it receives the updated desired configuration
- Service discovery is handled by the workspaces-proxy which creates host mappings for new ports exposed through the [user provided] ports service. This makes it possible to access the workspace ports through a url because all incoming requests to a workspace are forwarded through the workspaces-proxy.
Please ignore the Frontend UI changes as there are merely for testing/demo.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Demo (Version 2.0: Gitlab + Gitlab Workflow Extension) | demo |
| Demo (Version 1.0: Gitlab) | demo |
| Screenshot (VSCode Extension | ![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
