This message was deleted.
# harvester
a
This message was deleted.
b
Answering myself using a comment from myself in the past. Apply these annotations to the machine-plan secret in fleet-local associated with the machine that needs pre-drain:
Copy code
<http://rke.cattle.io/drain-options|rke.cattle.io/drain-options>: '{"deleteEmptyDirData":true,"disableEviction":false,"enabled":true,"force":true,"gracePeriod":0,"ignoreDaemonSets":true,"ignoreErrors":false,"postDrainHooks":[{"annotation":"<http://harvesterhci.io/post-hook|harvesterhci.io/post-hook>"}],"preDrainHooks":[{"annotation":"<http://harvesterhci.io/pre-hook|harvesterhci.io/pre-hook>"}],"skipWaitForDeleteTimeoutSeconds":0,"timeout":0}'
<http://rke.cattle.io/pre-drain|rke.cattle.io/pre-drain>: '{"deleteEmptyDirData":true,"disableEviction":false,"enabled":true,"force":true,"gracePeriod":0,"ignoreDaemonSets":true,"ignoreErrors":false,"postDrainHooks":[{"annotation":"<http://harvesterhci.io/post-hook|harvesterhci.io/post-hook>"}],"preDrainHooks":[{"annotation":"<http://harvesterhci.io/pre-hook|harvesterhci.io/pre-hook>"}],"skipWaitForDeleteTimeoutSeconds":0,"timeout":0}'
Then apply this annotation to the same secret once it’s done to kick off post-drain:
<http://rke.cattle.io/drain-done|rke.cattle.io/drain-done>: '{"deleteEmptyDirData":true,"disableEviction":false,"enabled":true,"force":true,"gracePeriod":0,"ignoreDaemonSets":true,"ignoreErrors":false,"postDrainHooks":[{"annotation":"<http://harvesterhci.io/post-hook|harvesterhci.io/post-hook>"}],"preDrainHooks":[{"annotation":"<http://harvesterhci.io/pre-hook|harvesterhci.io/pre-hook>"}],"skipWaitForDeleteTimeoutSeconds":0,"timeout":0}'
I couldn’t quite figure out how rke2 is updated and restarted, so I downloaded the rke2 version used in 1.2.0 manually and restarted the rke2-agent service… this let post-drain continue to replace OS and reboot