How can I empty an airflow worker deployed via Docker on Kubernetes cluster?

12/27/2018

I had deployed airflow on my cluster which was not well written, hence, filled up space. Now, I have improved my code but need to empty the old data. How can I achieve that since my workers are associated with a persistent volume?

When I enter the pod, I run the command:

rm -rf /usr/local/airflow/*

I get the following error:

rm: cannot remove '/usr/local/airflow/logs': Device or resource busy
rm: cannot remove '/usr/local/airflow/rootfs': Device or resource busy
-- aviral sanjay
airflow
docker
kubernetes

2 Answers

1/17/2019

In order to delete all the contents, I ran the command: rm -rf /usr/local/airflow/rootfs/*

The asterisk, in the end, made all the change as it told the system to remove all the contents and not the directory itself. This made no interaction with any mounted storage whatsoever.

-- aviral sanjay
Source: StackOverflow

12/27/2018

You need to umount those devices and then try to remove it:

umount /usr/local/airflow/logs /usr/local/airflow/rootfs
rm -rf /usr/local/airflow/logs /usr/local/airflow/rootfs

Hope this helps

-- Prafull Ladha
Source: StackOverflow