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
Migrate scheduler files interpodaffinity/filtering.go
,podtopologyspread/filtering.go
, volume_zone.go
to structured logging
#105931
Migrate scheduler files interpodaffinity/filtering.go
,podtopologyspread/filtering.go
, volume_zone.go
to structured logging
#105931
Conversation
442c306
to
818693c
Compare
/lgtm |
@@ -296,7 +296,7 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C | |||
tpKey := c.TopologyKey | |||
tpVal, ok := node.Labels[c.TopologyKey] | |||
if !ok { | |||
klog.V(5).Infof("node '%s' doesn't have required label '%s'", node.Name, tpKey) | |||
klog.V(5).InfoS("Node doesn't have required label", "nodeName", node.Name, "label", tpKey) |
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.
klog.V(5).InfoS("Node doesn't have required label", "nodeName", node.Name, "label", tpKey) | |
klog.V(5).InfoS("Node doesn't have required label", "node", klog.KObj(node), "label", tpKey) |
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.
hard to guess based on code what is the type of node. If it's not *v1.Node
than please replace it code with klog.KRef("", node.Name)
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.
Ok, that has been changed.
@@ -321,7 +321,7 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C | |||
} | |||
skew := matchNum + selfMatchNum - minMatchNum | |||
if skew > c.MaxSkew { | |||
klog.V(5).Infof("node '%s' failed spreadConstraint[%s]: MatchNum(%d) + selfMatchNum(%d) - minMatchNum(%d) > maxSkew(%d)", node.Name, tpKey, matchNum, selfMatchNum, minMatchNum, c.MaxSkew) | |||
klog.V(5).InfoS("Node failed spreadConstraint: matchNum + selfMatchNum - minMatchNum > maxSkew", "nodeName", node.Name, "topologyKey", tpKey, "matchNum", matchNum, "selfMatchNum", selfMatchNum, "minMatchNum", minMatchNum, "maxSkew", c.MaxSkew) |
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.
klog.V(5).InfoS("Node failed spreadConstraint: matchNum + selfMatchNum - minMatchNum > maxSkew", "nodeName", node.Name, "topologyKey", tpKey, "matchNum", matchNum, "selfMatchNum", selfMatchNum, "minMatchNum", minMatchNum, "maxSkew", c.MaxSkew) | |
klog.V(5).InfoS("Node failed spreadConstraint: matchNum + selfMatchNum - minMatchNum > maxSkew", "node", klog.KObj(node), "topologyKey", tpKey, "matchNum", matchNum, "selfMatchNum", selfMatchNum, "minMatchNum", minMatchNum, "maxSkew", c.MaxSkew) |
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.
Updated.
@@ -157,7 +157,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * | |||
} | |||
|
|||
if !volumeVSet.Has(nodeV) { | |||
klog.V(10).Infof("Won't schedule pod %q onto node %q due to volume %q (mismatch on %q)", pod.Name, node.Name, pvName, k) | |||
klog.V(10).InfoS("Won't schedule pod onto node due to volume (mismatch on label key)", "podName", pod.Name, "nodeName", node.Name, "PVName", pvName, "PVLabelKey", k) |
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.
klog.V(10).InfoS("Won't schedule pod onto node due to volume (mismatch on label key)", "podName", pod.Name, "nodeName", node.Name, "PVName", pvName, "PVLabelKey", k) | |
klog.V(10).InfoS("Won't schedule pod onto node due to volume (mismatch on label key)", "pod", klog.KObj(pod), "node", klog.KObj(node), "PVName", pvName, "PVLabelKey", k) |
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.
Updated.
818693c
to
cd1ca1e
Compare
/retest |
@@ -157,7 +157,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * | |||
} | |||
|
|||
if !volumeVSet.Has(nodeV) { | |||
klog.V(10).Infof("Won't schedule pod %q onto node %q due to volume %q (mismatch on %q)", pod.Name, node.Name, pvName, k) | |||
klog.V(10).InfoS("Won't schedule pod onto node due to volume (mismatch on label key)", "pod", klog.KObj(pod), "node", klog.KObj(node), "PVName", pvName, "PVLabelKey", k) |
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.
klog.V(10).InfoS("Won't schedule pod onto node due to volume (mismatch on label key)", "pod", klog.KObj(pod), "node", klog.KObj(node), "PVName", pvName, "PVLabelKey", k) | |
klog.V(10).InfoS("Won't schedule pod onto node due to volume (mismatch on label key)", "pod", klog.KObj(pod), "node", klog.KObj(node), "PV", klog.KRef("", pvName), "PVLabelKey", k) |
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.
yes, this place needs to be changed.
For non-namespaced object we can pass empty string to namespace argument.
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.
PR has been updated.
…pread/filtering.go`, `volume_zone.go` to structured logging
cd1ca1e
to
2783ddc
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Huang-Wei, 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Migrate scheduler files to structured logging
Which issue(s) this PR fixes:
Ref #105841
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/wg structured-logging
/area logging
/priority important-soon
/kind cleanup
/triage accepted
/sig instrumentation
/cc @kubernetes/wg-structured-logging-reviews