gitlab - 带有 Kaniko 和 EKS 的 GitLab CI 超时
问题描述
我正在尝试按照此处概述的使用 kaniko 的 GitLab 示例代码进行操作。我唯一改变的是我使用v1.7.0-debug
标签而不是简单的debug
.
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.7.0-debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
我的构建工作在以下行停滞不前:
Running with gitlab-runner 14.4.0 (4b9e985a)
on gitlab-runner-gitlab-runner-84d476ff5c-mkt4s HMty8QBu
Preparing the "kubernetes" executor
00:00
Using Kubernetes namespace: gitlab-runner
Using Kubernetes executor with image gcr.io/kaniko-project/executor:v1.7.0-debug ...
Using attach strategy to execute scripts...
Preparing environment
00:03
Waiting for pod gitlab-runner/runner-hmty8qbu-project-31186441-concurrent-0bbt8x to be running, status is Pending
Running on runner-hmty8qbu-project-31186441-concurrent-0bbt8x via gitlab-runner-gitlab-runner-84d476ff5c-mkt4s...
Getting source from Git repository
00:01
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/...
Created fresh repository.
Checking out 4d05d22b as ci...
Skipping Git submodules setup
Executing "step_script" stage of the job script
它只是停下来Executing "step_script"
,永远不会继续前进。我已经全面研究并阅读了尽可能多的文档,但无法解决此问题。
设置
- Amazon EKS 版本 1.21
- GitLab Runner Helm Chart 0.34.0 版
- kaniko 执行器镜像 v1.7.0-debug
解决方案
这最终成为了 Kubernetes 运行器本身在运行器配置中的配置方式的问题toml
。我们用于跑步者的默认容器映像需要修改PATH
环境变量,因此我们使用environment
配置设置来执行此操作,如此处所述。似乎这个PATH
变量不包括在 kaniko 调试映像中定义的 busybox shell。从那以后,我们将这个PATH
更改移到了我们的 Docker 映像中,它本来应该放在首位,并且一切都按预期工作。
推荐阅读
- python-asyncio - 使用 asyncio 平衡生产者-消费者中的任务
- python - 通过遍历列将数据框对象转换为浮动
- python - 如何在 discord.py 中获取移动状态指示器
- javascript - 当我在 Java 中单击 Google 搜索中的链接时,如何获取字符串的 URL。谷歌扩展开发
- objective-c - NSTimer 不会在 Objective C 中触发选择器
- python - 如何从文本文件中读取包含函数的字典?
- tomcat - 无法在“C:\Windows\System32\drivers\etc\hosts”文件中设置主机名的 https 上运行 Tomcat。不支持的协议
- laravel - Laravel基于关系模型值在boot方法中生成字段值
- html - 幻灯片上的图像放大得太大
- r - R 错误:未实现这些类型的比较。尝试根据匹配列过滤行时发生