-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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 AcceleratorStats to cri_stats_provider #96873
Conversation
@ruiwen-zhao: GitHub didn't allow me to request PR reviews from the following users: pradvenkat. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
/triage accepted |
@@ -780,6 +780,25 @@ func removeTerminatedContainers(containers []*runtimeapi.Container) []*runtimeap | |||
func (p *criStatsProvider) addCadvisorContainerStats( | |||
cs *statsapi.ContainerStats, | |||
caPodStats *cadvisorapiv2.ContainerInfo, | |||
) { | |||
if caPodStats.Spec.HasCustomMetrics { | |||
cs.UserDefinedMetrics = cadvisorInfoToUserDefinedMetrics(caPodStats) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why are we also adding un custom cAdvisor metrics here? Just for completeness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean this question to addCadvisorContainerCPUAndMemoryStats
or here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we also adding un custom cAdvisor metrics here?
Yeah I am basically keeping the same as the existing addCadvisorContainerStats
.
pkg/kubelet/stats/cri_stats_provider_test.go:702:9: should omit 2nd value from range; this loop is equivalent to |
cs *statsapi.ContainerStats, | ||
caPodStats *cadvisorapiv2.ContainerInfo, | ||
) { | ||
if caPodStats.Spec.HasCustomMetrics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely omit custom metrics if we only want CPU and Memory metrics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it looks like this is just maintaining the existing behavior
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dashpole, ruiwen-zhao 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 |
/milestone v1.20 |
@ruiwen-zhao: You must be a member of the kubernetes/milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your and have them propose you as an additional delegate for this responsibility. In response to this:
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. |
/milestone v1.20 |
/retest Review the full test history for this PR. Silence the bot with an |
/hold This should be reviewed by @kubernetes/release-team-leads as we are currently in code / test freeze for v1.20. |
/retest |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
1 similar comment
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
/retest |
/retest |
1 similar comment
/retest |
Can the hold be dropped now that master is open for 1.21? |
/hold cancel Thanks for waiting while we got 1.20 out. Hold dropped @liggitt |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently cadvisor_stats_provider provides AcceleratorStats but cri_stats_provider does not. As a result, when using cri_stats_provider, kubelet's Summary API does not have accelerator metrics. This PR tries to fix the discrepancy between the two providers.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Note that this PR does not add any new metric collecting logic, but rather merely passes the AcceleratorStats collected by cadvisor to cri_stats_provider. I am planning to cherry-pick this change to release branches after merging it to master.
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: