Allow to set docker default address pool (#1971)
* Allow to set docker default address pool * fixup! Allow to set docker default address pool Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com> * Revert unnecessary chart ver bump * Update docs for DOCKER_DEFAULT_ADDRESS_POOL_* * Fix the dockerd default address pool scripts to actually work as probably intended * Update the E2E testdata runnerdeployment to accomodate the new docker default addr pool options * Correct default dockerd addr pool doc Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com> Co-authored-by: Claudio Vellage <claudio.vellage@pm.me> Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
		
							parent
							
								
									fbdfe0df8c
								
							
						
					
					
						commit
						3b36a81db6
					
				|  | @ -69,6 +69,11 @@ spec: | |||
|         value: "${ROLLING_UPDATE_PHASE}" | ||||
|       - name: ARC_DOCKER_MTU_PROPAGATION | ||||
|         value: "true" | ||||
|       # https://github.com/docker/docs/issues/8663 | ||||
|       - name: DOCKER_DEFAULT_ADDRESS_POOL_BASE | ||||
|         value: "172.17.0.0/12" | ||||
|       - name: DOCKER_DEFAULT_ADDRESS_POOL_SIZE | ||||
|         value: "24" | ||||
| 
 | ||||
|       dockerMTU: 1400 | ||||
| 
 | ||||
|  |  | |||
|  | @ -1582,6 +1582,28 @@ spec: | |||
|           value: "true" | ||||
| ``` | ||||
| 
 | ||||
| There are a few advanced envvars also that are available only for dind runners: | ||||
| 
 | ||||
| ```yaml | ||||
| apiVersion: actions.summerwind.dev/v1alpha1 | ||||
| kind: RunnerDeployment | ||||
| metadata: | ||||
|   name: example-runnerdeployment | ||||
| spec: | ||||
|   template: | ||||
|     spec: | ||||
|       dockerdWithinRunnerContainer: true | ||||
|       image: summerwind/actions-runner-dind | ||||
|       env: | ||||
|         # Sets the respective default-address-pools fields within dockerd daemon.json | ||||
|         # See https://github.com/actions-runner-controller/actions-runner-controller/pull/1971 for more information. | ||||
|         # Also see https://github.com/docker/docs/issues/8663 for the default base/size values in dockerd. | ||||
|         - name: DOCKER_DEFAULT_ADDRESS_POOL_BASE | ||||
|           value: "172.17.0.0/12" | ||||
|         - name: DOCKER_DEFAULT_ADDRESS_POOL_SIZE | ||||
|           value: "24" | ||||
| ``` | ||||
| 
 | ||||
| ### Using IRSA (IAM Roles for Service Accounts) in EKS | ||||
| 
 | ||||
| > This feature requires controller version => [v0.15.0](https://github.com/actions-runner-controller/actions-runner-controller/releases/tag/v0.15.0) | ||||
|  |  | |||
|  | @ -17,6 +17,10 @@ jq ".\"mtu\" = ${MTU}" /home/runner/.config/docker/daemon.json > /tmp/.daemon.js | |||
| echo "DOCKERD_ROOTLESS_ROOTLESSKIT_MTU=${MTU}" | sudo tee -a /etc/environment | ||||
| fi | ||||
| 
 | ||||
| if [ -n "${DOCKER_DEFAULT_ADDRESS_POOL_BASE}" ] && [ -n "${DOCKER_DEFAULT_ADDRESS_POOL_SIZE}" ]; then | ||||
|   jq ".\"default-address-pools\" = [{\"base\": \"${DOCKER_DEFAULT_ADDRESS_POOL_BASE}\", \"size\": ${DOCKER_DEFAULT_ADDRESS_POOL_SIZE}}]" /home/runner/.config/docker/daemon.json > /tmp/.daemon.json && mv /tmp/.daemon.json /home/runner/.config/docker/daemon.json | ||||
| fi | ||||
| 
 | ||||
| if [ -n "${DOCKER_REGISTRY_MIRROR}" ]; then | ||||
| jq ".\"registry-mirrors\"[0] = \"${DOCKER_REGISTRY_MIRROR}\"" /home/runner/.config/docker/daemon.json > /tmp/.daemon.json && mv /tmp/.daemon.json /home/runner/.config/docker/daemon.json | ||||
| fi | ||||
|  |  | |||
|  | @ -16,6 +16,10 @@ jq ".\"mtu\" = ${MTU}" /etc/docker/daemon.json > /tmp/.daemon.json && mv /tmp/.d | |||
| echo "environment=DOCKERD_ROOTLESS_ROOTLESSKIT_MTU=${MTU}" >> /etc/supervisor/conf.d/dockerd.conf | ||||
| fi | ||||
| 
 | ||||
| if [ -n "${DOCKER_DEFAULT_ADDRESS_POOL_BASE}" ] && [ -n "${DOCKER_DEFAULT_ADDRESS_POOL_SIZE}" ]; then | ||||
|   jq ".\"default-address-pools\" = [{\"base\": \"${DOCKER_DEFAULT_ADDRESS_POOL_BASE}\", \"size\": ${DOCKER_DEFAULT_ADDRESS_POOL_SIZE}}]" /etc/docker/daemon.json > /tmp/.daemon.json && mv /tmp/.daemon.json /etc/docker/daemon.json | ||||
| fi | ||||
| 
 | ||||
| if [ -n "${DOCKER_REGISTRY_MIRROR}" ]; then | ||||
| jq ".\"registry-mirrors\"[0] = \"${DOCKER_REGISTRY_MIRROR}\"" /etc/docker/daemon.json > /tmp/.daemon.json && mv /tmp/.daemon.json /etc/docker/daemon.json | ||||
| fi | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue