actions-runner-controller: Docker container in dind containerMode cannot connect to Github
Checks
- I’ve already read https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/troubleshooting-actions-runner-controller-errors and I’m sure my issue is not covered in the troubleshooting guide.
- I am using charts that are officially provided
Controller Version
0.9.3
Deployment Method
ArgoCD
Checks
- This isn’t a question or user support case (For Q&A and community support, go to Discussions).
- I’ve read the Changelog before submitting this issue and I’m sure it’s not due to any recently-introduced backward-incompatible changes
To Reproduce
1. Deploy the gha-runner-scale-set-controller first with default values
Deploy `gha-runner-scale-set` chart with release name `arc-runner-set`
1.1 At this point, Github Actions work for simple workflow file.
2. Exec into `runner` container in `action-runne-set-****-runner-****` pod
3. Run `sudo apt update && sudo apt install git -y && git clone https://github.com/actions/actions-runner-controller.git` to make sure pod has access to public internet
4. Run `docker run --rm -it alpine sh -c "apk add git && git clone https://github.com/actions/actions-runner-controller.git"`
Describe the bug
Output from step 4:
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
(1/13) Installing ca-certificates (20240705-r0)
(2/13) Installing brotli-libs (1.1.0-r2)
(3/13) Installing c-ares (1.28.1-r0)
(4/13) Installing libunistring (1.2-r0)
(5/13) Installing libidn2 (2.3.7-r0)
(6/13) Installing nghttp2-libs (1.62.1-r0)
(7/13) Installing libpsl (0.21.5-r1)
(8/13) Installing zstd-libs (1.5.6-r0)
(9/13) Installing libcurl (8.9.0-r0)
(10/13) Installing libexpat (2.6.2-r0)
(11/13) Installing pcre2 (10.43-r0)
(12/13) Installing git (2.45.2-r0)
(13/13) Installing git-init-template (2.45.2-r0)
Executing busybox-1.36.1-r29.trigger
Executing ca-certificates-20240705-r0.trigger
OK: 20 MiB in 27 packages
Cloning into 'actions-runner-controller'...
fatal: unable to access 'https://github.com/actions/actions-runner-controller.git/': SSL connection timeout
Describe the expected behavior
docker run command above run correctly without SSL connection timeout error
Additional Context
Yaml manifest I using to deploy `gha-runner-scale-set-controller` and `gha-runner-scale-set`
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: arc
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: ghcr.io/actions/actions-runner-controller-charts
targetRevision: 0.9.3
chart: gha-runner-scale-set-controller
helm:
releaseName: arc
destination:
name: in-cluster
namespace: arc-systems
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=false
- ServerSideApply=true
- ApplyOutOfSyncOnly=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
revisionHistoryLimit: 3
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: arc-runner-set
namespace: argocd
spec:
project: default
destination:
name: in-cluster
namespace: arc-runners
syncPolicy:
automated:
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- ServerSideApply=true
- ApplyOutOfSyncOnly=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
revisionHistoryLimit: 3
source:
repoURL: ghcr.io/actions/actions-runner-controller-charts
targetRevision: 0.9.3
chart: gha-runner-scale-set
helm:
releaseName: arc-runner-set
parameters:
- name: controllerServiceAccount.namespace
value: arc-systems
- name: controllerServiceAccount.name
value: arc-gha-rs-controller
- name: githubConfigUrl
value: https://github.com/<organization>
- name: minRunners
value: "5"
- name: containerMode.type
value: dind
- name: githubConfigSecret
value: github-app-secret
Controller Logs
https://gist.github.com/duchuyvp/9b626aec67926976f09c52d303becd1a
Runner Pod Logs
This is logs when I push this workflow file:
name: Reproduce
on:
push:
branches: ['*']
jobs:
push-reproduce:
runs-on: arc-runner-set
steps:
- run: sudo apt update && sudo apt install git -y
- run: git clone https://github.com/actions/actions-runner-controller.git
- run: docker run --rm alpine sh -c "apk add git && git clone https://github.com/actions/actions-runner-controller.git"
https://gist.github.com/duchuyvp/6a5db187bfb3657a5361bcf62b0bd4ef
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 16 (1 by maintainers)
I ended up using the solution with a configMap as described in the discussion here.
You have to set
and then completely specify the template for the container, as described in the values file.
This could be be easier to add to the dind container, if my PR would be merged…
Try setting MTU for the docker daemon like:
The default docker daemon MTU is 1500, but my host network has 1460. So aligning the docker daemon MTU fixed it for me.
I was going to update today, I saw that moby/moby#43197 has been merged (earlier this year/late last year) and that solves my issue by adding this argument
--default-network-opt=bridge=com.docker.network.driver.mtu=1400.Now when dependabot calls the docker API (not using a shell, so the shims don’t help) creating a network for the updater container it now has the MTU set to 1400.
From the
dindcontainer in the dependabot runner pod.Output (cut for size):
Maybe these two options (container args and ConfigMap) should be added to the docs, considering how many reactions this issue got?
In my values file I specified (along with the init and runner container).
which works for the default network, but dependabot creates it’s own networks with no MTU setting, so it defaults to 1500 and dependabot breaks.
So that would fix the auto-created networks, but it won’t help if you create docker networks as part of your actions.