Skip to content

Sets HostNetwork to False for tests which do not require it#69525

Closed
claudiubelu wants to merge 1 commit intokubernetes:masterfrom
claudiubelu:tests-hostnetwork
Closed

Sets HostNetwork to False for tests which do not require it#69525
claudiubelu wants to merge 1 commit intokubernetes:masterfrom
claudiubelu:tests-hostnetwork

Conversation

@claudiubelu
Copy link
Copy Markdown
Contributor

@claudiubelu claudiubelu commented Oct 8, 2018

What this PR does / why we need it:

Some tests are setting HostNetwork=true, even if it is not required
for them to pass.

This patch will set the HostNetwork to false for those tests, allowing
them to be run on Windows nodes as well.

/sig testing

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #69559

Special notes for your reviewer:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 8, 2018
@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 8, 2018
@neolit123
Copy link
Copy Markdown
Member

SGTM

/ok-to-test
/kind cleanup
/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 9, 2018
@claudiubelu
Copy link
Copy Markdown
Contributor Author

/test pull-kubernetes-e2e-gce

@PatrickLang
Copy link
Copy Markdown
Contributor

/milestone 1.13
We need this to fix tests running on Windows so we can enable the periodic test runs

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@PatrickLang: You must be a member of the kubernetes/kubernetes-milestone-maintainers github team to set the milestone.

Details

In response to this:

/milestone 1.13
We need this to fix tests running on Windows so we can enable the periodic test runs

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.

Copy link
Copy Markdown
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2018
@feiskyer
Copy link
Copy Markdown
Member

/milestone 1.13
/retest

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@feiskyer: The provided milestone is not valid for this repository. Milestones in this repository: [next-candidate, v1.10, v1.11, v1.12, v1.13, v1.4, v1.5, v1.6, v1.7, v1.8, v1.9]

Use /milestone clear to clear the milestone.

Details

In response to this:

/milestone 1.13
/retest

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.

@feiskyer
Copy link
Copy Markdown
Member

/milestone v1.13

@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Oct 10, 2018
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will this function work if not in hostNetwork?

It seems to me that it is relying on hitting the host at a given port via localhost, which won't resolve the same when run in hostNetwork vs pod networked.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Apparently so. The only place this is used in, is in the test should preserve source pod IP for traffic thru service cluster IP, which is even marked as passed in the pull-kubernetes-e2e-kops-aws and the pull-kubernetes-e2e-gce jobs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Something is fishy about that. This is exec'ing into a pod and curling a localhost URL of a sleep pod.

func RunHostCmd(ns, name, cmd string) (string, error) {

It("should check kube-proxy urls", func() {

mux.HandleFunc("/proxyMode", func(w http.ResponseWriter, r *http.Request) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And why isn't this using the same exec pod spec / image?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't speak to history of this implementation, but there's been a lot of evolution in network tests, so it would not surprise me that this didn't get updated at some point to a consistent pod spec.

This function can not possibly work without hostNetwork.

The good news is that the calling test doesn't abort in this case, but just logs "the rest of this might fail". I guess you are NOT failing so this is a lot of noise about nothing.

But for this PR: you can't parameterize this function - it doesn't make sense.

Better fix: fix the calling test to skip this path entirely on windows, with a big comment about why

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 16, 2018
@k8s-ci-robot k8s-ci-robot added the sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. label Oct 30, 2018
@dims
Copy link
Copy Markdown
Member

dims commented Oct 30, 2018

/lgtm

Thanks @BCLAU

Copy link
Copy Markdown
Contributor

@timothysc timothysc left a comment

Choose a reason for hiding this comment

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

I like it!

/lgtm

@timothysc
Copy link
Copy Markdown
Contributor

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bclau, timothysc

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

The pull request process is described here

Details 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 Oct 30, 2018
@bgrant0607
Copy link
Copy Markdown
Member

@thockin @caseydavenport @bowei: This needs a thorough review by someone from SIG Network.

Which tests are intending to test service reachability from a pod perspective, and which ones, if any, are deliberately testing host reachability?

@bgrant0607 bgrant0607 removed approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 30, 2018
@bgrant0607
Copy link
Copy Markdown
Member

I removed lgtm and approval until we hear from SIG Network.

@timothysc
Copy link
Copy Markdown
Contributor

/assign @thockin

Copy link
Copy Markdown
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

I think a lot of these cannot be changed as you propose, but I also think a lot of the kube-proxy details should not be conformance tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't speak to history of this implementation, but there's been a lot of evolution in network tests, so it would not surprise me that this didn't get updated at some point to a consistent pod spec.

This function can not possibly work without hostNetwork.

The good news is that the calling test doesn't abort in this case, but just logs "the rest of this might fail". I guess you are NOT failing so this is a lot of noise about nothing.

But for this PR: you can't parameterize this function - it doesn't make sense.

Better fix: fix the calling test to skip this path entirely on windows, with a big comment about why


It("should function for node-Service: http", func() {
config := framework.NewNetworkingTestConfig(f)
config := framework.NewNetworkingTestConfig(f, false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see how this can pass - it is specifically about testing from the node...


It("should function for node-Service: udp", func() {
config := framework.NewNetworkingTestConfig(f)
config := framework.NewNetworkingTestConfig(f, false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This too

// Slow because we confirm that the nodePort doesn't serve traffic, which requires a period of polling.
It("should update nodePort: http [Slow]", func() {
config := framework.NewNetworkingTestConfig(f)
config := framework.NewNetworkingTestConfig(f, false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This too - DialFromNode should not work without HostNetwork

Expect(err).NotTo(HaveOccurred())

hostExec := framework.LaunchHostExecPod(f.ClientSet, f.Namespace.Name, "hostexec")
hostExec := framework.LaunchHostExecPod(f.ClientSet, f.Namespace.Name, "hostexec", false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How would this work without hostNet? It expects ss to be able to run and see kube-proxy

@PatrickLang
Copy link
Copy Markdown
Contributor

This needs to move to v1.14 so it can be updated once we have a decision on Windows conformance profiles and how they will be implemented.

@dims
Copy link
Copy Markdown
Member

dims commented Nov 14, 2018

ack @PatrickLang moving to 1.14

/milestone v1.14

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.13, v1.14 Nov 14, 2018
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2019
@fejta-bot
Copy link
Copy Markdown

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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 stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 12, 2019
@nikopen
Copy link
Copy Markdown
Contributor

nikopen commented Mar 1, 2019

@PatrickLang any chance this is merged in the following 2 weeks?
Code Freeze is in effect from next Friday.

@claudiubelu
Copy link
Copy Markdown
Contributor Author

Closed in favor of: #71468

@claudiubelu
Copy link
Copy Markdown
Contributor Author

For some reason, I cannot reopen this PR, but i've sent another PR for it. #78731

Additional information:

Running the tests affected by this PR on Linux nodes on different environments, yielded the following results:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/conformance Issues or PRs related to kubernetes conformance tests cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some tests do not require HostNetwork=true in order to pass