Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@aaronfern
Copy link
Member

What this PR does / why we need it:
This PR adds diagnostic logs to the function CalculateUtilizationOfResource()
This was needed due to recent occurrences where CA found nodes with 0% resource utilisation even though pods were scheduled on such nodes

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Added diagnostic logs to diagnose issues of nodes with 0% resource utilisation

@aaronfern aaronfern requested review from a team and unmarshall as code owners October 1, 2025 06:49
@gardener-robot gardener-robot added the needs/review Needs review label Oct 1, 2025
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 1, 2025
@gardener-robot gardener-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 1, 2025
if skipMirrorPods && podutils.IsMirrorPod(podInfo.Pod) {
daemonSetAndMirrorPodsUtilization.Add(resourceValue)
if detailedPodCount < maxDiagnosticPods {
fmt.Fprintf(&diagBuff, "pod %s/%s is a miror pod. Adding resource %q, value %v to daemonSetAndMirrorPodsUtilization\n", podInfo.Pod.Namespace, podInfo.Pod.Name, resourceName, resourceValue)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fmt.Fprintf(&diagBuff, "pod %s/%s is a miror pod. Adding resource %q, value %v to daemonSetAndMirrorPodsUtilization\n", podInfo.Pod.Namespace, podInfo.Pod.Name, resourceName, resourceValue)
fmt.Fprintf(&diagBuff, "pod %s/%s is a mirror pod. Adding resource %q, value %v to daemonSetAndMirrorPodsUtilization\n", podInfo.Pod.Namespace, podInfo.Pod.Name, resourceName, resourceValue)

Nitpick: typo: miror --> mirror


podsRequest.Add(resourceValue)
if detailedPodCount < maxDiagnosticPods {
fmt.Fprintf(&diagBuff, "pod %s/%s has requests %v\n", podInfo.Pod.Namespace, podInfo.Pod.Name, resourceValue)
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why resource name is only logged for mirror and daemonset pods?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a miss. Corrected the log message

Copy link
Member

@thiyyakat thiyyakat left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels Oct 21, 2025
@aaronfern aaronfern merged commit 7bbbe4c into gardener:machine-controller-manager-provider Oct 21, 2025
15 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 21, 2025
aaronfern added a commit to aaronfern/autoscaler that referenced this pull request Oct 21, 2025
aaronfern added a commit to aaronfern/autoscaler that referenced this pull request Oct 21, 2025
aaronfern added a commit to aaronfern/autoscaler that referenced this pull request Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/closed Issue is closed (either delivered or triaged)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants