8

这是场景:

  • 使用默认设置在谷歌云项目中创建了一个 kubernetes 集群
  • 在 gitlab 上配置自动开发操作,如快速入门中所示
  • 配置了一个 .gitlab-ci.yml 文件,如默认 kubernetes 模板所示(仅在设置正确的 DNS 后用我的自定义域更改了 KUBE_DOMAIN)
  • 一旦我将某些内容推送到主分支,就会在管道中触发构建作业,但它会失败。以下是控制台输出:

    Running with gitlab-runner 10.4.0-rc1 (fb4078b3)
  on docker-auto-scale (fa6cab46)
Using Docker executor with image registry.gitlab.com/gitlab-examples/kubernetes-deploy ...
Using docker image sha256:f5f6ae0793e2d8907a16c95a4062bc93a98de76e5caf476afdd75a55f0a4808c for predefined container...
Pulling docker image registry.gitlab.com/gitlab-examples/kubernetes-deploy ...
Using docker image registry.gitlab.com/gitlab-examples/kubernetes-deploy ID=sha256:94b90ce9f86870a6ad41b6696878dcd3f3053a34547e55acc90de6c6bdc09735 for build container...
Running on runner-fa6cab46-project-5122416-concurrent-0 via runner-fa6cab46-srm-1515712084-0dfb4a6e...
Cloning repository...
Cloning into '/builds/Cardamone/gulp-bootstrap-kickstart'...
Checking out 64575330 as master...
Skipping Git submodules setup
$ command build
Checking docker engine...
Missing docker engine to build images.
Running docker:dind locally with graph driver pointing to '/cache/docker'
Waiting for docker...
time="2018-01-11T23:09:41Z" level=warning msg="The \"-g / --graph\" flag is deprecated. Please use \"--data-root\" instead" 
time="2018-01-11T23:09:41.376948630Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found" 
time="2018-01-11T23:09:41.378177859Z" level=info msg="libcontainerd: new containerd process, pid: 27" 
time="2018-01-11T23:09:41.395771265Z" level=warning msg="failed to rename /cache/docker/tmp for background deletion: rename /cache/docker/tmp /cache/docker/tmp-old: no such file or directory. Deleting synchronously" 
time="2018-01-11T23:09:41.431476805Z" level=info msg="Graph migration to content-addressability took 0.00 seconds" 
time="2018-01-11T23:09:41.432582392Z" level=info msg="Loading containers: start." 
time="2018-01-11T23:09:41.433722690Z" level=warning msg="Running modprobe bridge br_netfilter failed with message: modprobe: can't change directory to '/lib/modules': No such file or directory\n, error: exit status 1" 
time="2018-01-11T23:09:41.434401118Z" level=warning msg="Running modprobe nf_nat failed with message: `modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1" 
time="2018-01-11T23:09:41.435034223Z" level=warning msg="Running modprobe xt_conntrack failed with message: `modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1" 
time="2018-01-11T23:09:41.513018523Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.18.0.0/16. Daemon option --bip can be used to set a preferred IP address" 
time="2018-01-11T23:09:41.545527019Z" level=info msg="Loading containers: done." 
time="2018-01-11T23:09:41.573837463Z" level=info msg="Daemon has completed initialization" 
time="2018-01-11T23:09:41.573958530Z" level=info msg="Docker daemon" commit=02c1d87 graphdriver=overlay2 version=17.06.0-ce 
time="2018-01-11T23:09:41.593210249Z" level=info msg="API listen on /var/run/docker.sock" 

Building application...
Building Heroku-based application using gliderlabs/herokuish docker image...
Unable to find image 'gliderlabs/herokuish:latest' locally
latest: Pulling from gliderlabs/herokuish
c02c7df4a131: Pulling fs layer
a3ed95caeb02: Pulling fs layer
ea92c993fbb7: Pulling fs layer
a3b5eef14734: Pulling fs layer
0e3c369b6f53: Pulling fs layer
9b9a3918b638: Pulling fs layer
848252ff228c: Pulling fs layer
df3273c9ccc6: Pulling fs layer
a3b5eef14734: Waiting
0e3c369b6f53: Waiting
9b9a3918b638: Waiting
848252ff228c: Waiting
df3273c9ccc6: Waiting
ea92c993fbb7: Verifying Checksum
ea92c993fbb7: Download complete
a3ed95caeb02: Verifying Checksum
a3ed95caeb02: Download complete
0e3c369b6f53: Verifying Checksum
0e3c369b6f53: Download complete
c02c7df4a131: Verifying Checksum
c02c7df4a131: Download complete
9b9a3918b638: Verifying Checksum
9b9a3918b638: Download complete
848252ff228c: Verifying Checksum
848252ff228c: Download complete
c02c7df4a131: Pull complete
a3ed95caeb02: Pull complete
ea92c993fbb7: Pull complete
df3273c9ccc6: Verifying Checksum
df3273c9ccc6: Download complete
a3b5eef14734: Verifying Checksum
a3b5eef14734: Download complete
time="2018-01-11T23:10:38.379477370Z" level=error msg="Not continuing with pull after error: failed to register layer: Error processing tar file(exit status 1): write /usr/share/terminfo/n/ncr7900iv: no space left on device" 
time="2018-01-11T23:10:38.380896411Z" level=info msg="Layer sha256:2381de6cd1138e16c1f8c55d20f32bfb251442371409c8390f0c0ae7201f0e2f cleaned up" 
docker: failed to register layer: Error processing tar file(exit status 1): write /usr/share/terminfo/n/ncr7900iv: no space left on device.
See 'docker run --help'.
ERROR: Job failed: exit code 1

也许我在谷歌平台的集群/项目配置中遗漏了一些东西?我需要“以某种方式添加空间”到应用程序吗?

感谢您的任何建议

4

2 回答 2

2

我无法重现您看到的错误。我的步骤:

  • 在新的 Gitlab 项目中完成AutoDevOps 快速入门中的步骤
  • (使用 Ruby on Rails 模板)
  • 通过 Gitlab UI 创建了一个 Kubernetes 集群——使用了默认的 Node 机器类型:(n1-standard-2 (2 vCPUs, 7.5 GB memory)不过,CPU 和内存与磁盘空间不足无关。)每个节点都有一个 100GB 的启动磁盘(“标准永久性磁盘”。)
  • 启用 AutoDevops
  • 删除了 repo 的 Dockerfile,以便 GitLab默认使用 Heroku buildpacks(以提取引发错误的 Docker 映像)
  • 管道运行。并且build舞台能够完全下载图像:
Digest: sha256:1de05c84afa3abf1df66efca6a928d33ea142cd564b31c7e33d09c8104d8534a
Status: Downloaded newer image for gliderlabs/herokuish:latest

关于为什么您会看到“空间不足”错误的想法: gliderlabs/herokuish:latest是 1.21GB 的 Docker 映像。Build 阶段本身正在运行“docker in docker”(一个 Kubernetes pod,它是一个 docker 容器,正在尝试执行其 docker pull 命令。)

虽然(从您的df -h)看来 gitlab 运行程序 Pod 总共有足够的磁盘空间,但 Docker 可能正在写入临时文件系统并且空间不足。一种解决方案可能是将 Docker 的存储驱动程序从 VFS 切换到 Overlay,在您的.gitlab_ci.yml

variables:
  DOCKER_DRIVER: overlay2

资料来源: https ://docs.gitlab.com/ce/ci/docker/using_docker_build.html#using-the-overlayfs-driver https://gitlab.com/gitlab-com/support-forum/issues/1025

于 2019-06-11T13:48:25.577 回答
0

转到:操作-> kubernetes -> 单击您的集群名称-> 高级设置-> 清除集群缓存

再次运行您的管道!

于 2021-02-18T09:09:47.210 回答