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

Properly handle graceful shutdown of the kubelet plugin #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

klueska
Copy link
Contributor

@klueska klueska commented Dec 9, 2024

Without this change, deletion of the DRA driver will not remove resource slices. There is an open issue in kubernetes (kubernetes/kubernetes#128696) that would ensure that these resources slices get removed even if there is no graceful shutdown, but it's still good to shutdown gracefully regardless.

@klueska klueska requested a review from pohly December 9, 2024 13:53
@k8s-ci-robot k8s-ci-robot requested review from byako and elezar December 9, 2024 13:53
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 9, 2024
Copy link
Contributor

@byako byako left a comment

Choose a reason for hiding this comment

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

lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: byako, klueska

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

@pohly
Copy link
Contributor

pohly commented Dec 11, 2024

Some description of what problem this change addresses would be useful. Both commit message and PR description are empty.


err = driver.Shutdown(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

So I looked at the updated description and it is still not clear to me why this change is needed. Why did the old code not work?

As far as I can tell, the change just shuffles code around. Before and after, driver.Shutdown should have been reached. What am I missing?

Copy link
Contributor

Choose a reason for hiding this comment

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

And how exactly do you delete the driver such that the ResourceSlice doesn't get deleted? Deleting either the entire Helm release and the DaemonSet by itself seem to clean up the ResourceSlice for me.

signal.Notify(sigc, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
<-sigc
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this is implementing some of the wrapping provided by signal.NotifyContext. Would using that simplify things here?


err = driver.Shutdown(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

And how exactly do you delete the driver such that the ResourceSlice doesn't get deleted? Deleting either the entire Helm release and the DaemonSet by itself seem to clean up the ResourceSlice for me.

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants