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

Kubelet: implement support for podAndContainerStatsFromCRI #103095

Conversation

haircommander
Copy link
Contributor

@haircommander haircommander commented Jun 22, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR uses the CRI changes in #102789 to implement the feature gate for kubernetes/enhancements#2364

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add support for PodAndContainerStatsFromCRI featuregate, which allows a user to specify their pod stats must also come from the CRI, not cAdvisor.

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



- [KEP]: https://github.com/kubernetes/enhancements/issues/2371

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ 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 Jun 22, 2021
@haircommander
Copy link
Contributor Author

/sig node
/priority important-soon

@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 22, 2021
@@ -1272,6 +1385,15 @@ message FilesystemUsage {
// This may not equal InodesCapacity - InodesAvailable because the underlying
// filesystem may also be used for purposes other than storing images.
UInt64Value inodes_used = 4;
// TODO: Unclear how the remaining fields relate to container stats. Is it filled in cAdvisor?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also TODO: I have yet to actually figure out how to wire these up yet. it's not clear this should be the responsibility of CRI impl or cAdvisor

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this make more sense as a cumulative stat rather than associating with an ImageSpec for a container?

@haircommander haircommander force-pushed the podAndContainerStatsFromCRI-feature-gate branch from cb4ee8f to e9eecec Compare June 22, 2021 16:02
@ehashman ehashman added this to Triage in SIG Node PR Triage Jun 22, 2021
@ehashman
Copy link
Member

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 22, 2021
@ehashman ehashman moved this from Triage to Waiting on Author in SIG Node PR Triage Jun 22, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 22, 2021
@haircommander haircommander force-pushed the podAndContainerStatsFromCRI-feature-gate branch 2 times, most recently from fdc3fd5 to d6b6860 Compare June 23, 2021 19:17
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 23, 2021
@rphillips
Copy link
Member

This looks ready.

/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 1, 2021
}
// CRI implementation doesn't support ListPodSandboxStats, warn and fallback.
klog.V(5).ErrorS(err,
"CRI implementation must be updated to support ListPodSandboxStats if PodAndContainerStatsFromCRI feature gate is enabled. Falling back to populating with cAdvisor; this call will fail in the future.",
Copy link
Member

Choose a reason for hiding this comment

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

+1 on adding this as a fallback

@bobbypage
Copy link
Member

LGTM as well, thanks @haircommander for your work on this.

We plan to add new E2E tests that will validate CRI stats using running against updated container runtime implementations that support the new endpoints.

/lgtm

@ehashman ehashman moved this from Needs Reviewer to Needs Approver in SIG Node PR Triage Nov 4, 2021
@derekwaynecarr
Copy link
Member

thanks @haircommander and @bobbypage for the mutual work on this.
/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobbypage, derekwaynecarr, haircommander, mikebrow

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, 2021
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit 33de444 into kubernetes:master Nov 8, 2021
SIG Node PR Triage automation moved this from Needs Approver to Done Nov 8, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Nov 8, 2021
mansikulkarni96 added a commit to mansikulkarni96/kubernetes that referenced this pull request May 1, 2023
Part of kubernetes/enhancements#2371

Follow up to the initial work introducing CRI API fields for Windows
metrics collection kubernetes#110754
Windows equivalent work for adding support for Windows
podAndContainerStatsFromCRI kubernetes#103095, which will allow users to get
Windows pod and container stats only from CRI.

Signed-off-by: mansikulkarni96 <mankulka@redhat.com>
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/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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/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

9 participants