极狐GitLab 正式推出面向 GitLab 老旧版本(12.x、13.x、14.x、15.x 等)免费用户的专业升级服务,点击查看详情

返回列表 发布新帖

极狐Gitlab WorkSpaces - 03

802 0
发表于 2024-4-2 12:41:28 | 显示全部楼层 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
本帖最后由 胡睿智 于 2024-4-2 12:49 编辑

6. 创建 debvfile
在任何想使用 workspace 功能的项目中创建 Devfile。

  1. schemaVersion: 2.2.0
  2. variables:
  3.   registry-root: registry.gitlab.com
  4. components:
  5.   - name: tooling-container
  6.     attributes:
  7.       gl/inject-editor: true
  8.     container:
  9.       image: "{{registry-root}}/gitlab-org/remote-development/gitlab-remote-development-docs/ubuntu:22.04"
  10.       env:
  11.         - name: KEY
  12.           value: VALUE
  13.       endpoints:
  14.         - name: http-3000
  15.           targetPort: 3000
复制代码



注意:  
  • namespace 需要修改为 workspaces-proxy 所在的namespace.
  • 请确保在 devfile 中使用的容器镜像能够支持arbitrary user IDs

7. Create a workspace
  • 在左侧边栏中 选择 Search or go to.
  • 选择 Your work
  • 选择 Workspaces
  • 选择 New workspace
  • 在Select project的下拉列表中,选择一个带有 .devfile.yaml 文件的项目。
  • 在Select cluster agent的下拉列表中,选择项目所属组拥有的集群代理。
  • 在Time before automatic termination,输入工作区自动终止前的小时数。这个超时是一个安全措施,防止工作区消耗过多的资源或无限期运行。
  • 选择 Create workspace

工作区的启动可能需要几分钟时间。在 Preview 部分,选择你的工作区即可打开它。同时,你还可以访问终端,并安装任何所需的依赖项。
Remote development settings
SettingDescription
enabledIndicates whether remote development is enabled for the GitLab agent.
dns_zoneDNS zone where workspaces are available.
gitlab_workspaces_proxyNamespace where gitlab-workspaces-proxy is installed.
network_policyFirewall rules for workspaces.
default_resources_per_workspace_containerDefault requests and limits for CPU and memory per workspace container.
max_resources_per_workspaceMaximum requests and limits for CPU and memory per workspace.


回复

使用道具 举报

意见建议

Email:forum@gitlab.cn
  • 关注公众号
  • 添加专业顾问
Copyright © 2001-2024 极狐GitLab论坛 版权所有 All Rights Reserved. 鄂ICP备2021008419号-1|鄂公网安备42018502006137号
关灯 快速发帖
扫一扫添加专业顾问
返回顶部
快速回复 返回顶部 返回列表