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

Add network stats for Windows containers #70121

Merged
merged 2 commits into from
Jan 25, 2019

Conversation

feiskyer
Copy link
Member

What this PR does / why we need it:

An alternative way for #67884 and #69920.

  • To get node network stats, it invokes 'Get-NetAdapterStatistics | ConvertTo-Json' to fetch all adapters statistics
  • To get pod stats, it invokes hcsshim directly to fetch container's network statistics.

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 #64901

Special notes for your reviewer:

Refer #67884 (comment).

Release note:

Add network stats for Windows nodes and pods.

/assign @yujuhong @PatrickLang
/milestone v1.13
/sig windows

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 23, 2018
@k8s-ci-robot k8s-ci-robot added sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 23, 2018
@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Oct 23, 2018
@k8s-ci-robot k8s-ci-robot added 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. labels Oct 23, 2018
@feiskyer feiskyer changed the title Win net stats3 Add network stats for Windows containers Oct 23, 2018
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels Oct 23, 2018
@feiskyer
Copy link
Member Author

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 23, 2018
@feiskyer
Copy link
Member Author

/cc @dineshgovindasamy

@feiskyer
Copy link
Member Author

/test pull-kubernetes-verify

@feiskyer
Copy link
Member Author

/retest

Copy link

@dineshgovindasamy dineshgovindasamy left a comment

Choose a reason for hiding this comment

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

Thanks Pengfei. PR looks good.
/lgtm

pkg/kubelet/winstats/network_stats.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 24, 2018
@feiskyer
Copy link
Member Author

/test pull-kubernetes-integration

@feiskyer
Copy link
Member Author

ping @yujuhong Could you have a look at this?

@feiskyer
Copy link
Member Author

feiskyer commented Nov 6, 2018

ping @yujuhong

@benmoss
Copy link
Member

benmoss commented Nov 7, 2018

This all seems reasonable to me. The cri_stats_provider.go code seems like it might benefit from a higher abstraction, since it's now weaving between the Linux-only cadvisor calls and the Windows-only listContainerNetworkStats call, but I'm not sure that needs to happen now.

@feiskyer
Copy link
Member Author

feiskyer commented Nov 8, 2018

The cri_stats_provider.go code seems like it might benefit from a higher abstraction, since it's now weaving between the Linux-only cadvisor calls and the Windows-only listContainerNetworkStats call, but I'm not sure that needs to happen now.

The best way I think is abstracting the windows features also under cadvisor interface, but that's not possible yet because there's no enough information from hcsshim (which means CRI interface should be changed to fetch them).

And there is also another impl #69920 for this feature which I think is cleaner, but that requires changes of CRI.

@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 19, 2018
@feiskyer
Copy link
Member Author

Rebased and conflicts solved.

@feiskyer
Copy link
Member Author

feiskyer commented Jan 9, 2019

ping @yujuhong @derekwaynecarr Help to take at the PR again?

@PatrickLang PatrickLang added this to In Review in SIG-Windows Jan 11, 2019
Copy link
Contributor

@yujuhong yujuhong left a comment

Choose a reason for hiding this comment

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

Looks good mostly with some comments.

pkg/kubelet/winstats/network_stats.go Outdated Show resolved Hide resolved
pkg/kubelet/winstats/network_stats.go Show resolved Hide resolved
pkg/kubelet/stats/cri_stats_provider_windows.go Outdated Show resolved Hide resolved
@yujuhong
Copy link
Contributor

/cc @pjh FYI

@k8s-ci-robot
Copy link
Contributor

@yujuhong: GitHub didn't allow me to request PR reviews from the following users: pjh, FYI.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @pjh FYI

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
Member Author

@yujuhong Addressed comments. PTAL

@feiskyer
Copy link
Member Author

/retest

@yujuhong
Copy link
Contributor

@feiskyer does the existing summary API test check for this, and does the test pass after the change?
Since there is no presubmit testing yet, I'd like to make sure the features added will be tested.

@feiskyer
Copy link
Member Author

The test covers some, but not all of this, because of invoking powershell commands. We may figure out how to mock powershell later.

@feiskyer
Copy link
Member Author

/retest

@yujuhong
Copy link
Contributor

The test covers some, but not all of this, because of invoking powershell commands. We may figure out how to mock powershell later.

Actually I was talking about e2e tests, but having unit test is good too. We need something to prevent regression. I'm slightly uncomfortable that we can't run node e2e on windows since summary API test is also there.
Can you file a bug to add test coverage for stats in general?

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 25, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, yujuhong

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 Jan 25, 2019
@k8s-ci-robot k8s-ci-robot merged commit 697c231 into kubernetes:master Jan 25, 2019
SIG-Windows automation moved this from In Review to Done (v.1.14) Jan 25, 2019
@k8s-ci-robot
Copy link
Contributor

@feiskyer: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-local-e2e-containerized 9cf38de link /test pull-kubernetes-local-e2e-containerized

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@feiskyer feiskyer deleted the win-net-stats3 branch January 26, 2019 04:51
@jterry75
Copy link

@kevpar - FYI - You should look at this to match CRI stats

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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add network stats for Windows containers
10 participants