gitlab-ci 在 kubernetes 上缓存,minio-service 不工作

gitlab-ci cache on kubernetes with minio-service not working

我是 运行 gitlab,当前的 gitlab-runner 10.3.0 作为 kubernetes 部署,带有用于缓存的 minio-server。一切都使用 helm 部署。 gitlab runner 的 helm 是使用这个 values.yml:

定制的
cache:
  cacheType: s3
  s3ServerAddress: http://wizened-tortoise-minio:9000
  s3BucketName: runners
  s3CacheInsecure: false
  cacheShared: true
  secretName: s3access
  # s3CachePath: gitlab_runner

s3access 被定义为集群秘密,runners 桶存在于 minio 上。问题是虽然构建日志没有显示任何问题,但缓存没有被填充:

Checking cache for onekey-6
Successfully extracted cache
...
Creating cache onekey-6...
.m2/repository/: found 5909 matching files         
Created cache

查看 minio 桶,它是空的。我相信 gitlab runner s3ServerAddress 是正确的,因为更改它显示为构建过程中的错误(此处例如使用 https 时):

Checking cache for onekey-6...
WARNING: Retrying...                               
WARNING: Retrying...                               
Failed to extract cache

Creating cache onekey-6...
.m2/repository/: found 5909 matching files         
Uploading cache.zip to https://wizened-tortoise-minio/runners/gitlab_runner/runner/b87d7697/project/1644/onekey-6 
WARNING: Retrying...                               
Uploading cache.zip to https://wizened-tortoise-minio/runners/gitlab_runner/runner/b87d7697/project/1644/onekey-6 
WARNING: Retrying...                               
Failed to create cache
Uploading cache.zip to https://wizened-tortoise-minio/runners/gitlab_runner/runner/b87d7697/project/1644/onekey-6 
FATAL: Put https://wizened-tortoise-minio

我还添加了 echo $S3_SERVER_ADDRESS 到构建中,但它是空的。

那么:我需要如何配置 gitlab-runner 以使用 minio 进行缓存?

注意:我知道 gitlab-ci cache on kubernetes with minio-service not working anymore

为了完整起见,问题出在:

s3ServerAddress: http://wizened-tortoise-minio:9000

虽然 gitlab 显然做了一些 "presence" 检查它在哪里接受 http:// 但在实际克隆缓存时却没有。不幸的是,它似乎默默地吞下了错误。工作版本需要:

s3ServerAddress: wizened-tortoise-minio:9000

https://gitlab.com/gitlab-org/gitlab-runner/issues/3539#note_103371588

打开了 gitlab issue