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

Fix stats for podAndContainerStatsFromCRI #113291

Merged

Conversation

mengjiao-liu
Copy link
Member

@mengjiao-liu mengjiao-liu commented Oct 24, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

According to the feature gate PodAndContainerStatsFromCRI design, we should only obtain stats data from CRI when the feature gate PodAndContainerStatsFromCRI is enabled. When getting data from CRI fails, we will use cAsvisor stats to populate summary stats information. However, when the current code can obtain stats from CRI, it does not return in time. stats mixed with cAdvisor is still returned.

The commit that introduced this issue: 6b3f8e5
in PR: #103095

The current unit in the file pkg/kubelet/stats/cri_stats_provider_test.go is for the case where there is no test PodAndContainerStatsFromCRI for true.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix the PodAndContainerStatsFromCRI feature, instead of supplementing with stats from cAdvisor.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2371-cri-pod-container-stats#current-fulfiller-of-metrics-endpoints--future-proposal

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 24, 2022
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 24, 2022
@pacoxu pacoxu added this to Triage in SIG Node PR Triage Oct 24, 2022
@mengjiao-liu
Copy link
Member Author

/sig instrumentation

@k8s-ci-robot k8s-ci-robot added the sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. label Oct 24, 2022
@haircommander
Copy link
Contributor

🤦 thanks @mengjiao-liu !
/ok-to-test
/triage accepted

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. triage/accepted Indicates an issue or PR is ready to be actively worked on. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 31, 2022
@mengjiao-liu mengjiao-liu changed the title Fix stats for podAndContainerStatsFromCRI [WIP]Fix stats for podAndContainerStatsFromCRI Nov 2, 2022
@mengjiao-liu mengjiao-liu marked this pull request as ready for review November 2, 2022 06:32
@mengjiao-liu mengjiao-liu force-pushed the fix-podAndContainerStatsFromCRI branch from 261e317 to c518315 Compare November 2, 2022 06:38
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 2, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2022
@matthyx matthyx moved this from Needs Reviewer to Needs Approver in SIG Node PR Triage Nov 2, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2022
@mengjiao-liu mengjiao-liu force-pushed the fix-podAndContainerStatsFromCRI branch from c518315 to 7df446a Compare November 3, 2022 09:41
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 3, 2022
@mengjiao-liu mengjiao-liu changed the title [WIP]Fix stats for podAndContainerStatsFromCRI Fix stats for podAndContainerStatsFromCRI Nov 3, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 3, 2022
@mengjiao-liu
Copy link
Member Author

mengjiao-liu commented Nov 3, 2022

Since PR #110897 is pending by #110897 (comment), The tests required for this PR have been added, no more waiting for PR #110897 to be merged.

@matthyx
Copy link
Contributor

matthyx commented Nov 3, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added 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 3, 2022
@mengjiao-liu mengjiao-liu force-pushed the fix-podAndContainerStatsFromCRI branch from 7df446a to 2940484 Compare November 7, 2022 02:51
@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 7, 2022
@mengjiao-liu
Copy link
Member Author

/assign @dashpole

@matthyx
Copy link
Contributor

matthyx commented Nov 7, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2022
@dashpole
Copy link
Contributor

dashpole commented Nov 7, 2022

/approve
cc @bobbypage

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dashpole, mengjiao-liu

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 Nov 7, 2022
@mengjiao-liu
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit f328d3d into kubernetes:master Nov 8, 2022
SIG Node PR Triage automation moved this from Needs Approver to Done Nov 8, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Nov 8, 2022
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants