Kubernetes Runner does not see docker for DIND
I install HELM chart with next values
gitlabUrl: https://gitlab.com
rbac:
create: true
replicas: 3
runnerToken: xxxxxxxxxx
runners:
cache: {}
config: |
[[runners]]
[runners.kubernetes]
namespace = "{{.Release.Namespace}}"
image = "ubuntu:16.04"
privileged = true
[[runners.kubernetes.volumes.host_path]]
name = "docker"
mount_path = "/var/run/docker.sock"
read_only = true
host_path = "/var/run/docker.sock"
secrets: []
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: false
runAsNonRoot: true
service:
enabled: false
type: ClusterIP
sessionServer:
enabled: false
terminationGracePeriodSeconds: 3600
tolerations: []
useTini: false
volumeMounts: []
volumes: []
Running my build with docker:find failed
services:
- docker:dind
before_script:
- docker images
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
Error log
[0KRunning with gitlab-runner 16.2.0 (782e15da)[0;m
[0K on gitlab-runner-1692633847-577fbb5898-xtj7x H7vUzLuft, system ID: r_1m7fvAiFYBsa[0;m
section_start:1692638002:prepare_executor
[0K[0K[36;1mPreparing the "kubernetes" executor[0;m[0;m
[0KUsing Kubernetes namespace: default[0;m
[0KUsing Kubernetes executor with image docker:latest ...[0;m
[0KUsing attach strategy to execute scripts...[0;m
section_end:1692638002:prepare_executor
[0Ksection_start:1692638002:prepare_script
[0K[0K[36;1mPreparing environment[0;m[0;m
Waiting for pod default/runner-h7vuzluft-project-45371364-concurrent-0-4isy48uv to be running, status is Pending
Waiting for pod default/runner-h7vuzluft-project-45371364-concurrent-0-4isy48uv to be running, status is Pending
ContainersNotReady: "containers with unready status: [build helper svc-0]"
ContainersNotReady: "containers with unready status: [build helper svc-0]"
Running on runner-h7vuzluft-project-45371364-concurrent-0-4isy48uv via gitlab-runner-1692633847-577fbb5898-xtj7x...
section_end:1692638010:prepare_script
[0Ksection_start:1692638010:get_sources
[0K[0K[36;1mGetting source from Git repository[0;m[0;m
[32;1mFetching changes with git depth set to 20...[0;m
Initialized empty Git repository in /builds/ok-sf/sf/.git/
[32;1mCreated fresh repository.[0;m
[32;1mChecking out 2eb10672 as detached HEAD (ref is flux-apps)...[0;m
[32;1mSkipping Git submodules setup[0;m
section_end:1692638013:get_sources
[0Ksection_start:1692638013:step_script
[0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m
[32;1m$ docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY[0;m
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[32;1m$ echo "Compiling the code..."[0;m
Compiling the code...
[32;1m$ docker pull $IMAGE:latest || true[0;m
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[32;1m$ docker build -t $IMAGE:$CI_COMMIT_REF_SLUG -t $IMAGE:$CI_COMMIT_SHA -f $SRC_PATH/Dockerfile .[0;m
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
section_end:1692638017:step_script
[0Ksection_start:1692638017:cleanup_file_variables
[0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m
section_end:1692638018:cleanup_file_variables
[0K[31;1mERROR: Job failed: command terminated with exit code 1
[0;m
I've tried to pass variables with DOCKER_HOST
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
Also tried to wait like described here: gitlab-org/gitlab-runner#27215 (closed)
No luck.
I'm running k8s on EKS Managed nodes in AWS
UPD. Tried to use docker:stable-dind
no luck
Edited by Ivan Skiridomov