Skip to content

Remote Development Workspaces Runbook

  • Workspaces are Kubernetes Pods created in the customer’s Kubernetes cluster.
  • The Kuberenetes cluster is connected to GitLab by the GitLab Agent for Kubernetes(agentk). The GitLab Agent Server(kas) proxies this connection.
  • The remote_development module of GitLab Agent for Kubernetes(agentk) runs a reconciliation loop with GitLab. It sends the information of the actual state of the workspaces in each request. Rails persists this information and responds back with the desired state of workspaces. The agentk acts on the response by applying the Kuberentes manifests received.
  • Accessing the workspace is protected by Gitlab Workspaces Proxy installed in the customer’s Kubernetes cluster which authenticates and authorizes the request before forwarding it to the workspaces.
  • Each worksapce is injected with GitLab VS Code fork for Workspaces which is sideloaded with the GitLab Workflow VS Code extension.
  • On workspace creation, the project from which the workspace is created is cloned. If SSHD is present, it will be started.
  • Isolated sandbox environments running on customer’s infrastructure.
  • GitLab VS Code fork for Workspaces is accessible over the browser which connects to the VS Code Remote Extension Host running inside the workspace.
  • Accessing the servers running inside the workspace through the browser or over SSH.
  • AI features like Duo Chat and Code Suggestions powered through the GitLab Workflow VS Code extension.
  • Available for Premium or Ultimate subscription
  • Available on gitlab.com, dedicated and self-managed instances. For all the offerings, customers are expected to bring their own infrastructure for hosting Workspaces.

Determine which REST/GraphQL endpoint is affected and the problems that can arise with them from the list below. See Steps to debug issue for further debugging according to the issue.

  • REST - POST /api/internal/kubernetes/agent_configuration
    • GitLab Agent for Kubernetes(agentk) will not be able to fetch its configuration through GitLab Agent Server(kas) and would thus fail.
    • Database updates to the workspaces agent configs table will be affected.
  • REST - GET /api/internal/kubernetes/modules/remote_development/prerequisites
    • The remote_development module of the GitLab Agent for Kubernetes(agentk) will not be able start as it requires this information and would thus fail.
  • REST - POST /api/internal/kubernetes/modules/remote_development/reconcile
    • The remote_development module of the GitLab Agent for Kubernetes(agentk) will not be able to send information to Rails about the current state of workspaces in Kubernetes resources nor receive information from Rails about the changes in new/existing workspaces.
  • GraphQL - mutation workspaceCreate
    • Users will not be able tpo create a new workspace.
  • GraphQL - mutation workspaceUpdate
    • Users will not be able to change the desired state of an existing workspace.
  • GraphQL - mutation namespaceCreateRemoteDevelopmentClusterAgentMapping
    • Users will not be able to map/unmap cluster agents in the group settings.
  • GraphQL - query Namespace.remoteDevelopmentClusterAgents
    • Users will not be able to list the available agents while creating a new workpace.
    • Users will not be able to list the mapped/unmapped cluster agents in the group settings.
  • GraphQL - query CurrentUser.workspaces
    • Users will not be able to list their workspaces.
  • GraphQL - query projects
    • Users will not be able to list the projects or get the devfiles for a project while creating a new workpace.

NOTE: This source of information is for historic data, but is not updated in real time.

If GitLab Agent for Kubernetes(agentk) configuration are not reflected during workspace creation

Section titled “If GitLab Agent for Kubernetes(agentk) configuration are not reflected during workspace creation”

If GitLab Agent for Kubernetes(agentk) is not visible during workspace creation

Section titled “If GitLab Agent for Kubernetes(agentk) is not visible during workspace creation”

If devfile is not visible during workspace creation

Section titled “If devfile is not visible during workspace creation”

If workspace creation fails due to error in devfile

Section titled “If workspace creation fails due to error in devfile”

This cannot be debugged unless you have access to the underlying Kuberenetes cluster.

  • Wait for 10 minutes.
  • Check the details of the underlying workspace pod.
  • Check the logs of the underlying workspace pod.

This cannot be debugged unless you have access to the underlying Kuberenetes cluster.

  • Check the details of the underlying workspace pod.
  • Check the logs of the underlying workspace pod.
  • Check if the cloning of the project succeeded.
  • Check if the tools(e.g. SSHD, GitLab VS Code fork for Workspaces) are copied to the workspace.
  • Check if the tools started correctly.
  • Check if any of the container of the workspace pod are restarting.
  • Check if the underlying Kubernetes persistent volume was created successfully.

If workspace will not start or stop or restart or terminate

Section titled “If workspace will not start or stop or restart or terminate”
  • Check if the GitLab Agent for Kubernetes(agentk) configuration has remote_development.enabled set to true.
  • Check if the GitLab Agent for Kubernetes(agentk) is connected.
  • Check if the GitLab Agent for Kubernetes(agentk) is running in Kubernetes.
  • Check if GitLab Agent Server(kas) is available.

If the extensions marketplace is not available in workspace

Section titled “If the extensions marketplace is not available in workspace”

The extensions marketplaces settings are inherited from WebIDE settings.

Any changes to the above settings will only be reflected in new workspaces.

If extenion is not available in extensions marketplace

Section titled “If extenion is not available in extensions marketplace”

The default extensions marketplace used is OpenVSX. The user can configure their custom extensions marketplace.

  • Check if the extension is available on OpenVSX or on the custom marketplace set by the user. There can be extensions which are available on the official VS Code extensions marketplace which are not available other extensions marketplace. This is controlled by the extension author.
  • Check if the extension works in a remote environment. There are many extensions which only work on desktop or only on browser but not on remote.

If AI capabilities are not available in workspace

Section titled “If AI capabilities are not available in workspace”
  • Check if the licenses are properly set.
cluster_agent_id = 1
cluster_agent = Clusters::Agent.find(cluster_agent_id)

Get the workspaces agent config for a cluster agent

Section titled “Get the workspaces agent config for a cluster agent”
cluster_agent_id = 1
workspace_agent_config = RemoteDevelopment::WorkspacesAgentConfig.find_by(cluster_agent_id: cluster_agent_id)
cluster_agent_id = 1
cluster_agent = Clusters::Agent.find(cluster_agent_id)
workspaces = cluster_agent.workspaces

Get workspaces agent config for a workspace

Section titled “Get workspaces agent config for a workspace”
workspace_id = 1
workspace = RemoteDevelopment::Workspace.find(workspace_id)
workspace_agent_config = workspace.workspace_agent_config
workspace_id = 1
workspace = RemoteDevelopment::Workspace.find(workspace_id)
workspace_variables = workspace.workspace_variables
workspace_id = 1
workspace_variables = RemoteDevelopment::WorkspaceVariable.find_by(workspace_id: workspace_id)
workspace_agent_config = RemoteDevelopment::WorkspacesAgentConfig.new
workspace_agent_config.enabled = "invalid_value"
workspace_agent_config.valid?
workspace_agent_config.errors

Get raw agent configuration stored in the project files

Section titled “Get raw agent configuration stored in the project files”

See search_projects.query.graphql.

Get the mappings of cluster agent for a group

Section titled “Get the mappings of cluster agent for a group”

See get_agents_with_mapping_status.query.graphql.