Gitlab-runner S3 cache using service:dind

5/9/2020

Attempting setup gitlab runner with service:dind, using local minio cache? Gitlab runner is ignoring my distributed cache setup, and no information on why except:

No URL provided, cache will be not uploaded to shared cache server. Cache will be stored only locally.

Prior to setting :dind, I did see some attempts to hit S3 ( ignoring local minio server URL though somehow). So possibly problem is with dind however I've checked all values with docs. Debug mode also gives limited info. I've setup minio cache in same kubernetes cluster/namespace as runner, and validated I can list minio buckets directly from the dind runner ( when paused with sleep 3600). I am aware the dind service creates another container that doesn't have env vars as parent. So I'm setting directly in the .gitlab_ci for dest runner, still no help

setup:

gitlab-runner helm values.yaml:

  cache:
    cacheType: "s3"
    cacheShared: "true"
    s3ServerAddress: "http://minio-service:9000"
    secretName: "minio"
    s3BucketName: "my-bucket"
    s3BucketLocation: "us-west-2"

.gitlab_ci vars:

  CACHE_TYPE: "s3"
  CACHE_SHARED: "true"
  CACHE_S3_SERVER_ADDRESS: "http://minio-service:9000"
  CACHE_S3_BUCKET_NAME: "my-bucket"
  CACHE_S3_BUCKET_LOCATION: "us-west-2"
  CACHE_SECRET_NAME: "minio"

cache:
  key: "${CI_COMMIT_REF_SLUG}"
  paths: ( just trying anything )
    - "${CI_PROJECT_DIR}/public"
    - "${CI_PROJECT_DIR}/build"
-- user4673824
gitlab-ci
gitlab-ci-runner
kubernetes-helm
minio

0 Answers