Skip to content

Provide the ability to perform actions before termination of the VM #1131

Description

@CaptainIRS

How to categorize this issue?

/area control-plane
/kind enhancement

What would you like to be added:

As an operator, I would like to have the ability to perform some actions after the draining of the node and before the deletion of the VM. For example, in a self-hosted control plane whose VMs are managed by MCM, there should be a mechanism to remove the etcd member associated with the VM from the etcd cluster before MCM deletes the VM as part of replacement/rolling updates.

Proposed changes:

  • A phase in the Machine lifecycle to signify to external actors that the drain is complete and that it is safe to perform the out-of-band operations necessary before termination of the VM. Suggestion: a WaitingForPreTerminationHooks phase.
  • An annotation, whose absence could be used by MCM as a signal to proceed with the termination of the VM. Suggestion: pre-terminate.delete.hook.machine.sapcloud.io/<name>=true where <name> is set by the external actor for identification. So, once the external actor is done with the actions (like removal of the etcd member), it will delete the annotation from the Machine object, after which MCM can continue with the deletion flow. This annotation shall be set by the external actor as part of the MachineTemplate while creating the MachineDeployment.

Tasks:

  • Confirm the naming of the phase and annotation
  • Implement the handling of the introduced phase and annotation

Why is this needed:

Part of gardener/gardener#15298

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions