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 manually started docker containers to have internet access #2002

Closed
ghost opened this issue Nov 24, 2017 · 9 comments
Closed

Allow manually started docker containers to have internet access #2002

ghost opened this issue Nov 24, 2017 · 9 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@ghost
Copy link

ghost commented Nov 24, 2017

Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST

Environment:

  • Cloud provider or hardware configuration: Bare Metal
    Kubespray version (commit) (git rev-parse --short HEAD): 00916de
    Network plugin used: Calico

Anything else do we need to know:
Normally kubespray totally disables docker networking with --ip-masq=false and --iptables=false so when I start a docker container outside of kubernetes it won't have access to any network specially internet. Sometimes this is necessary, like when I want to use a application that needs internet access and doesn't have kubernetes manifest or more importantly when I use Docker-out-side-of-Docker for CI/CD pipelines and jobs creates docker containers when I run docker build inside kubernetes powered runner, the new container does not have internet access and I can't build docker image. I've manually added following iptables rule and enabled internet access.

iptables -t nat -A POSTROUTING -s 172.17.0.0/16 ! -d 10.0.0.0/8 -m addrtype ! --dst-type LOCAL -j MASQUERADE
@Atoms Atoms added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 21, 2018
@MatthiasLohr
Copy link

Yes, please!

@bal291
Copy link

bal291 commented Nov 21, 2018

yes I am having the same issues.

@ssbarnea
Copy link
Contributor

I can confirm that the iptables command did fix the issue, now the question is how to make this part of kubespray? I don't want to deploy it manually or to worry that reboot will mess it.

@manics
Copy link
Contributor

manics commented Jan 21, 2019

kubespray has a docker_iptables_enabled variable:

docker_iptables_enabled: "false"

@ssbarnea
Copy link
Contributor

@manics is this parameter enough to enable internet access? (same effects as the previous iptables line?). If true, we need to update the comment above that line in ordert to inform user about its side-effect.

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 11, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zerohoon0102
Copy link

After modifying

to iptable and
docker_iptables_enabled: "false"
to "true", jenkins started building the image normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

8 participants