Skip to content

Adjust preemption event message to do not include preemptor pod metadata #114923

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

Merged

Conversation

mimowo
Copy link
Contributor

@mimowo mimowo commented Jan 9, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Part of #114882 (in event)

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix regression in 1.23: Do not include preemptor pod metadata in the event message

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. 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. labels Jan 9, 2023
@k8s-ci-robot
Copy link
Contributor

@mimowo: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jan 9, 2023
@mimowo
Copy link
Contributor Author

mimowo commented Jan 9, 2023

/sig scheduling

@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 9, 2023
@mimowo
Copy link
Contributor Author

mimowo commented Jan 9, 2023

/assign @Huang-Wei

@mimowo
Copy link
Contributor Author

mimowo commented Jan 9, 2023

/retest

@mimowo mimowo force-pushed the do-not-leak-pod-name-in-event branch from a8fb0f0 to f79a34d Compare January 9, 2023 17:30
@mimowo
Copy link
Contributor Author

mimowo commented Jan 9, 2023

/retest

@Huang-Wei
Copy link
Member

/lgtm
/approve

Thanks.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 9, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: cada52366f7e507a80bcf0499897f1b1d22adbee

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Huang-Wei, mimowo

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 Jan 9, 2023
@k8s-ci-robot k8s-ci-robot merged commit 1e3946c into kubernetes:master Jan 9, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.27 milestone Jan 9, 2023
@@ -378,8 +378,8 @@ func (ev *Evaluator) prepareCandidate(ctx context.Context, c Candidate, pod *v1.
return
}
}
fh.EventRecorder().Eventf(victim, pod, v1.EventTypeNormal, "Preempted", "Preempting", "Preempted by %v/%v on node %v",
pod.Namespace, pod.Name, c.Name())
fh.EventRecorder().Eventf(victim, pod, v1.EventTypeNormal, "Preempted", "Preempting", "Preempted by a pod scheduled by %s on node %v",
Copy link
Member

Choose a reason for hiding this comment

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

-1

The scheduler name is already part of the Event metadata:

  Type    Reason     Age   From                                   Message
  ----    ------     ----  ----                                   -------
  Normal  Scheduled  24s   gke.io/optimize-utilization-scheduler  Successfully assigned alpha/sample-job-9fq6c-khbf4 to gke-demo-default-pool-938ff563-473d

Copy link
Member

Choose a reason for hiding this comment

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

Good point.

Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  19s   default-scheduler  Successfully assigned default/pause1 to node-1
  Normal  Preempted  4s    default-scheduler  Preempted by a pod scheduled by default-scheduler on node node-1

@mimowo it's good to remove the duplicated scheduler-name in event, and then update the cherry-pick PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, updated the cherry-pick PR by cherry-picking the fix, PTAL.

k8s-ci-robot added a commit that referenced this pull request Jan 13, 2023
…23-upstream-release-1.25

Automated cherry pick of #114923: Do not leak cross namespace pod metadata in preemption events
k8s-ci-robot added a commit that referenced this pull request Jan 13, 2023
…23-upstream-release-1.26

Automated cherry pick of #114923: Do not leak cross namespace pod metadata in preemption events
k8s-ci-robot added a commit that referenced this pull request Jan 13, 2023
…23-upstream-release-1.24

Automated cherry pick of #114923: Do not leak cross namespace pod metadata in preemption events
k8s-ci-robot added a commit that referenced this pull request Jan 13, 2023
…23-upstream-release-1.23

Automated cherry pick of #114923: Do not leak cross namespace pod metadata in preemption events
@mimowo mimowo deleted the do-not-leak-pod-name-in-event branch March 18, 2023 18:32
@liggitt liggitt added the kind/regression Categorizes issue or PR as related to a regression from a prior release. label Sep 9, 2023
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants