Skip to content

Support reason parameter on pod delete #1462

Closed
@bgrant0607

Description

@bgrant0607

Forked from #137. /cc @dchen1107

Client-initiated terminations are triggered by DELETE via the API. As discussed in #137, I'd like clients to be able to pass in arbitrary termination reasons, to facilitate ecosystem management extensions, as well as user-provided reasons.

I suggest a URL parameter on DELETE: ?reason=MYREASON.

The apiserver would record this as the termination reason, regardless what Kubelet reported when the termination actually occurred.

Once we generate termination events, the reason should be visible there.

We plan to pass termination reasons to lifecycle hooks (#1445). This means we'll need a way to pass the reason to Kubelet. I suggest implementing a "deletion dance", which we've also talked about doing in the apiserver: rather than actually deleting objects, we should first put them into a deleting/terminated state, so that clients can observe their final state. The reason could be passed this way.

Of course, objects eventually need to be deleted, and there's always a chance that some clients may not have observed the final state. We still need to handle that, but we should ensure it doesn't happen often. Think of this as a declarative graceful termination.

See also #1370.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.sig/nodeCategorizes an issue or PR as relevant to SIG Node.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions