Related Issue
https://github.com/longhorn/longhorn/issues/1882
Scenario 1- Allow Recurring Job While Volume Is Detached disabled, attached pod scaled down while the recurring backup was in progress.
- Create a volume, attach to a pod of a statefulSet, and write 800 Mi data into it.
- Set a recurring job.
- While the recurring job is in progress, scale down the pod to 0 of the statefulSet.
- Verify after backup completion, the volume gets detached.
- Verify volume not gets attached during the next scheduled recurring backup time.
Scenario 2- Allow Recurring Job While Volume Is Detached enabled, attached pod scaled down while the recurring backup was in progress.
- Enable
Allow Recurring Job While Volume Is Detached - Create a volume, attach to a pod, and write 800 Mi data into it.
- Set a recurring job.
- While the recurring job is in progress, scale down the pod to 0.
- Verify after backup completion, the volume gets detached.
- Verify volume again gets attached when next round of recurring job started.
- Verify after backup completion, the volume gets detached.
Scenario 3- Cron job and volume attached to the same node, Node is powered down and volume detached.
- Enable
Allow Recurring Job While Volume Is Detached - Attach a volume to pod of a statefulSet, write data into it and set a recurring backup.
- Detach from the pod by scaling down the statefulSet.
- The attached node to volume is powered down when the recurring job backup was in progress.
- The volume becomes detached due to the node power off, while the cron job pod remains in the Running state.
- The cron job pod remains in Running state for about 7 mins and then another pod gets created.
- Verify the volume get attached to another node and once the job is completed, volume gets detached.
Scenario 4- Cron job and volume attached to the same node, Node is restarted.
- Enable
Allow Recurring Job While Volume Is Detached - Attach a volume to pod of a statefulSet, write data into it and set a recurring backup.
- Detach from the pod by scaling down the statefulSet.
- The attached node to volume is powered down when the recurring job backup was in progress.
- The volume becomes detached due to the node power off, while the cron job pod remains in the Running state.
- Power on the node.
- Verify the volume get attached to different node and the backup job is completed.
Scenario 5- Cron job and volume attached to the same/different node, Node is powered down and Pod Deletion Policy When Node is Downis set as delete-both-statefulset-and-deployment-pod
- Set
node-down-pod-deletion-policytodelete-both-statefulset-and-deployment-pod - Enable
Allow Recurring Job While Volume Is Detached - Attach a volume to pod of a statefulSet, write data into it and set a recurring backup.
- The attached node to volume is powered down when the recurring job backup was in progress.
- After 7 min the cron job takes over the creation of another pod of stateful set and the volume gets auto attached to another node, completes the backup and gets detached.