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

kic: Use bind IP for minikube IP on linux #7267

Closed

Conversation

priyawadhwa
Copy link

@priyawadhwa priyawadhwa commented Mar 26, 2020

We want to return the external ip when running $(minikube ip). This was causing a bug in TestAddons/parallel/Registry, which expects $(minikube ip):5000 to connect to an nginx service when the registry addon is enabled.

make integration -e TEST_ARGS="-test.run TestAddons/parallel/Registry --profile=minikube --cleanup=false --minikube-start-args="--driver=docker""

fixes #7191

The registry addon expects $(minikube ip):5000 to be exposed. Since `minikube ip` is localhost for the docker driver, we need to expose port 5000 on creation in case the registry addon is running so that this works as expected.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 26, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: priyawadhwa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2020
@priyawadhwa
Copy link
Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 26, 2020
@minikube-pr-bot
Copy link

Error: running mkcmp: exit status 1

Priya Wadhwa added 2 commits March 26, 2020 15:15
We want to return the external ip when running $(minikube ip). This was causing a bug in `TestAddons/parallel/Registry`, which expects $(minikube ip):5000 to connect to an nginx service when the registry addon is enabled.
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 26, 2020
@priyawadhwa priyawadhwa changed the title Expose port 5000 to host machine for docker/podman drivers kic: Use bind IP for docker-env command and external IP otherwise Mar 26, 2020
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 26, 2020
@tstromberg
Copy link
Contributor

/ok-to-test

@codecov-io
Copy link

codecov-io commented Mar 26, 2020

Codecov Report

Merging #7267 into master will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7267      +/-   ##
==========================================
- Coverage   37.86%   37.84%   -0.03%     
==========================================
  Files         147      147              
  Lines        9089     9094       +5     
==========================================
  Hits         3442     3442              
- Misses       5222     5227       +5     
  Partials      425      425              
Impacted Files Coverage Δ
cmd/minikube/cmd/docker-env.go 46.07% <0.00%> (-2.38%) ⬇️

@minikube-pr-bot
Copy link

All Times minikube: [ 62.954377 64.257964 64.012811]
All Times Minikube (PR 7267): [ 61.605680 63.319693 64.318429]

Average minikube: 63.741717
Average Minikube (PR 7267): 63.081267

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 7267) |
+----------------------+-----------+--------------------+
| minikube v           |  0.217919 |           0.206064 |
| Creating kvm2        | 40.587631 |          40.061374 |
| Preparing Kubernetes | 21.187745 |          21.307882 |
| Pulling images       |           |                    |
| Launching Kubernetes |           |                    |
| Waiting for cluster  |           |                    |
+----------------------+-----------+--------------------+

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to verify this on mac os. (our CI machines for mac os dont work) so need to verify the tests manaully

@@ -111,10 +110,6 @@ func Running(name string) ClusterController {
exit.WithError("Unable to get driver IP", err)
}

if driver.IsKIC(host.DriverName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not wrong, I believe we still need this for macOS.
we can not hit the IP of the container but the DefaultBind 127.0.0.1

@priyawadhwa
Copy link
Author

So on Mac I'm getting an i/o timeout:

=== RUN   TestAddons
=== RUN   TestAddons/parallel
=== RUN   TestAddons/parallel/Registry
=== PAUSE TestAddons/parallel/Registry
=== CONT  TestAddons/parallel/Registry
2020/03/26 16:32:07 [DEBUG] GET http://172.17.0.2:5000
2020/03/26 16:32:37 [ERR] GET http://172.17.0.2:5000 request failed: Get http://172.17.0.2:5000: dial tcp 172.17.0.2:5000: i/o timeout
2020/03/26 16:32:37 [DEBUG] GET http://172.17.0.2:5000: retrying in 1s (4 left)
2020/03/26 16:33:08 [ERR] GET http://172.17.0.2:5000 request failed: Get http://172.17.0.2:5000: dial tcp 172.17.0.2:5000: i/o timeout

@tstromberg
Copy link
Contributor

If I understand, this test can't really work on macOS, because the port isn't exposed.

@medyagh - What's the mechanism that regular users should be using to expose this port properly? The test should be using that, at least in the IsKIC() case.

@afbjorklund
Copy link
Collaborator

Not sure there is anything proper about 5000, probably should use a tunnel to expose it ?

Where docker0 is broken

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 1, 2020
Priya Wadhwa added 2 commits April 1, 2020 10:43
On linux, we want to keep the IP set to the internal IP. This is because this IP is exposed and so we can use it on Linux.

This doesn't fix the IP issue on mac or windows, it's just a temporary fix for the linux case. We will need to find a way to expose internal ports on Mac/Windows so that the registry addon works as expected on those platforms.
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 1, 2020
@priyawadhwa priyawadhwa changed the title kic: Use bind IP for docker-env command and external IP otherwise kic: Use bind IP for minikube IP on linux Apr 1, 2020
@priyawadhwa
Copy link
Author

cc @medyagh PTAL as a temporary fix on linux

@minikube-pr-bot
Copy link

All Times minikube: [ 64.116723 58.581442 63.641151]
All Times Minikube (PR 7267): [ 63.333213 63.467703 61.655178]

Average minikube: 62.113105
Average Minikube (PR 7267): 62.818698

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 7267) |
+----------------------+-----------+--------------------+
| minikube v           |  0.214848 |           0.208009 |
| Creating kvm2        | 39.665113 |          40.325322 |
| Preparing Kubernetes | 20.703763 |          20.505551 |
| Pulling images       |           |                    |
| Launching Kubernetes |           |                    |
| Waiting for cluster  |           |                    |
+----------------------+-----------+--------------------+

@priyawadhwa priyawadhwa closed this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestAddons/parallel/Registry consistent docker failure: GET http://127.0.0.1:5000 giving up after 5 attempts
7 participants