【问题标题】:Bind docker socket with a Kubernetes runner and share volume将 docker socket 与 Kubernetes 运行器绑定并共享卷
【发布时间】:2021-02-05 17:13:26
【问题描述】:

我正在使用带有 Helm 的 gitlab runner install 并在 Google Cloud Kubernetes 引擎上运行。

这是我的 values.yaml 文件中的跑步者配置:

runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        image = "ubuntu:16.04"
        [[runners.kubernetes.volumes.host_path]]
          name = "docker-sock"
          mount_path = "/var/run/docker.sock"
          host_path = "/var/run/docker.sock"

当我启动与主机共享卷的构建时,我收到此错误:

ERROR: for c2abac41f403_******_haproxy_1  Cannot start service haproxy: error while creating mount source path '/builds/****/****/docker/test/haproxy.cfg': mkdir /builds: read-only file system

所以我决定将卷 pvc 添加到我的跑步者配置中

...
        [[runners.kubernetes.volumes.pvc]]
          name = "runner-claim"
          mount_path = "/builds"
...

但我收到此错误:

Pod "runner-7vyyjqpv-project-8275433-concurrent-0dhn9h" is invalid: [spec.containers[0].volumeMounts[2].mountPath: Invalid value: "/builds": must be unique, spec.containers[1].volumeMounts[2].mountPath: Invalid value: "/builds": must be unique]

我的目标是在 docker 中使用 docker socket 代替 docker 以获得更好的性能。

你能帮帮我吗?

最好的问候

【问题讨论】:

    标签: gitlab google-kubernetes-engine gitlab-ci-runner


    【解决方案1】:

    我会尝试使用@viniciusxyz 发布的here 的解决方案。似乎他也面临同样的问题。

    【讨论】:

    • 谢谢,但这对我没有帮助:(
    • 我建议将此问题移至特定于 gitlab-ci-runner 以获得更多可见性,因为这似乎不是 GKE 问题,而是特定于 gitlab-ci 配置。
    猜你喜欢
    • 2018-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-15
    • 2021-09-17
    • 1970-01-01
    • 2019-09-12
    相关资源
    最近更新 更多