Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing --enable-docker-bridge to amazon-eks-ami bootstrap #942

Closed
danielchalef opened this issue Jun 25, 2019 · 10 comments
Closed

Allow passing --enable-docker-bridge to amazon-eks-ami bootstrap #942

danielchalef opened this issue Jun 25, 2019 · 10 comments
Labels
area/nodegroup kind/feature New feature or request

Comments

@danielchalef
Copy link

danielchalef commented Jun 25, 2019

Why do you want this feature?
A number of common Kubernetes use cases, including CI and machine learning experiment management, require building docker images on Kubernetes (more generally known as "docker-on-docker"). Amazon recently disabled the docker bridge on the amazon-eks-ami family of images, breaking this capability (see Docker in Docker no longer works without docker0 bridge). Even more recently, Amazon added a --enable-docker-bridge switch to the AMI bootstrap script to reenable the bridge.

What feature/behavior/change do you want?
Allow configuring an eksctl nodegroup for "docker-on-docker" use. If a nodegroup is configured in this way, eksctl will pass the --enable-docker-bridge to the AMI bootstrap.

@danielchalef danielchalef added the kind/feature New feature or request label Jun 25, 2019
@errordeveloper
Copy link
Contributor

errordeveloper commented Jun 26, 2019

I believe this will be doable by allowing to customise /etc/docker/daemon.json, in the spirit similar to how we handle kubelet.yaml (see #886).

So you would be looking to do something like this:

nodeGroups:
  - name: ng1-with-docker-in-docker
     extraDockerConfig:
       bridge: docker0
       live-restore: false

To be clear, we don't use bootstrap.sh. For the reference, it does this:

# Replace with custom docker config contents.
if [[ -n "$DOCKER_CONFIG_JSON" ]]; then
    echo "$DOCKER_CONFIG_JSON" > /etc/docker/daemon.json
    systemctl restart docker
fi

if [[ "$ENABLE_DOCKER_BRIDGE" = "true" ]]; then
    # Enabling the docker bridge network. We have to disable live-restore as it
    # prevents docker from recreating the default bridge network on restart
    echo "$(jq '.bridge="docker0" | ."live-restore"=false' /etc/docker/daemon.json)" > /etc/docker/daemon.json
    systemctl restart docker
fi

I think we will want to have the config itself unse /etc/eksctl/docker.json, so that we own it in full and can ensure the content is deterministic. That will require a drop-in unit also, which is also something we already equipped to do.

@tobemedia
Copy link

Run in the same problem using eksctl to setup a binder / jupyterhub setup. The built in docke-on-docker build process fails due to dns errors. Is there a workaround to pass --enable-docker-bridge to eksctl commands?

@gofman8
Copy link

gofman8 commented Jul 17, 2019

Looks like it's possible. See #522

@mhumeSF
Copy link

mhumeSF commented Jul 17, 2019

@SkySonR #522 looks specific to ubuntu ami and not eks amazon linux default ami's. Is there documentation on how this flag can get passed to bootstrap on eks-amazon-linux?

Looks to be for both. Investigating on how to use...

@diestrin
Copy link

I'm having the same DNS problem. @SkySonR do you know how can we pass the argument for that PR you mention?

@Arau
Copy link

Arau commented Jul 28, 2019

Same here. Is there a way to achieve this in the meantime that this is developed properly?
Can I edit the host template by hand or anything alike?

Thank you for the work and great project!

@tobemedia
Copy link

tobemedia commented Jul 29, 2019

Using a workaround described at the Jupyter Forum I was able to fix the dns errors.
Create a new eks cluster using the linked config file as a starting point.

eksctl create cluster --config-file aws_eks_config.yml

Gist: aws_eks_config.yml

@antodoms
Copy link

@tobemedia Your solution worked! I was trying to build docker container using buildkite agent inside our Kubernetes cluster and it was throwing this error!

@kalbir kalbir closed this as completed May 25, 2020
@kalbir
Copy link

kalbir commented May 25, 2020

I'm closing this given the workaround from @tobemedia above. We are unlikely to implement any other features for this in eksctl.

@duanyutong
Copy link

duanyutong commented Jun 5, 2020

Why not implement something clean like --enable-docker-bridge? The above workaround (specifically preBootstrapCommandsin in the yaml config) is preventing my p3 nodes from joining the cluster when I call eksctl create nodegroup --config-file=nodegroups.yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nodegroup kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants