Event > List of events > Lifecycle events >
remove event is emitted only once per unit: when the Juju controller is ready to remove the unit completely. The
stop event is emitted prior to this, and all necessary steps for handling removal should be handled there.
remove event is the last event a unit will ever see before going down, right after
stop. It is exclusively fired when the unit is in the Teardown phase.
Handlers for this event should ensure that the workload is ‘gracefully’ shutdown.
Note that by the time
removeis fired, storage, relations and all charm resources will likely no longer be available. If you need to cleanup any of those, listen to
On kubernetes charms, the
remove event will occur on pod churn, when the unit dies. On machine charms, the stop event will be fired when a unit is put down.
|Scenario||Example Command||Resulting Events|
Of course, removing an application altogether will result in these events firing on all units.
If the unit has any relations active or any storage attached at the time the removal occurs, these will be cleaned up (in no specific order) between
remove. This means the unit will receive
stop -> (*-relation-broken | *-storage-detaching) -> remove.
Observing this event in Ops
ops, you can observe the
remove event like you would any other:
remove event object does not expose any specific attributes.
Last updated 5 months ago.