BE: Generate k8s service on workspace_ports db updates
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Work on this issue](https://contributors.gitlab.com/manage-issue?action=work&projectId=278964&issueIid=509836)
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=509836)
</details>
<!--IssueSummary end-->
MR: Pending
<!--
The first line of this issue description must be one of the following:
1. `MR: Pending`
2. `MR: <MR link with trailing +>`,
3. If there are multiple MRs:
```
MRs:
- <MR 1 link with trailing +>`
- <MR 2 link with trailing +>`
- ...
```
4. `MR: No MR`
...and the first description line of the MR should be `Issue: <Issue link with trailing +>`
For more context, see:
https://about.gitlab.com/handbook/engineering/development/dev/create/ide/index.html#relationship-of-issues-to-mrs
-->
<!--
The following sections should be filled out as part of the refinement process before the issue is prioritized.
For more context, see:
https://about.gitlab.com/handbook/engineering/development/dev/create/ide/#2-pre-iteration-planning-meeting
-->
## Description
We want to enable creation of a separate [`Service`](https://kubernetes.io/docs/concepts/services-networking/service/) in the k8s namespace for the running workspace whenever there is a new record in the `workspace_ports` table or an existing port's `visibility` is updated.
The Service should contain relevant port mappings that enable exposure of listed ports to allow TCP traffic through the workspaces-proxy.
This issue is a pre-requisite to allow users to open/close ports from a UI within the workspace. Whenever a workspace port is opened/closed we want to update this information in the db and then either add/remove relevant ports in a Service definition that should be communicated to the gitlab-agent along with other workspace k8s resources so that it can update the Service in Kubernetes.
On workspace creation we want to add the ports defined by the user in the workspace devfile in the `endpoints` attribute. And these ports should then be added to a new `"user-ports"` Service. Whenever a port is opened/closed we need to trigger the gitlab-agent to apply these changes to the k8s Service object.
## Acceptance Criteria
- [ ] Devfile ports added to `workspace_ports` table on workspace creation
- [ ] Service object created in k8s cluster that contains ports from the `workspace_ports` on workspace creation
- [ ] Service object updated and port added to the object when a new workspace port is created
- [ ] Service object updated and port removed from the object when a workspace port is deleted or a workspace is terminated.
- [ ] New workspace_variable created on workspace creation, called `GL_WORKSPACE_ID` which contains the globalID of the workspace e.g ( `gid://gitlab/RemoteDevelopment::Workspace/231`)
- [ ] `workspace_ports` records deleted when a workspace is terminated.
- [ ] Generate URL for accessing `OPEN` ports
- [ ] URL is no longer accessible after port is closed
- [ ] Add logging/error handling for workspace port creation/update
- [ ] Add unit tests
<!-- Replace with other type, e.g. bug or maintenance, if appropriate -->
<!-- Replace with other subtype if appropriate -->
<!-- By default, all issues start in the unprioritized status. See https://handbook.gitlab.com/handbook/engineering/development/dev/create/remote-development/#-planning-process -->
<!-- For simplicity and to avoid triage bot warnings about missing workflow labels, we will default to issues starting at the refinement phase -->
issue