Kubernetes Executor in apache airflow: Pod getting deleted immediately with error

7/16/2019

i am using apache airflow with KubernetesExecutor. I am running the setup in Minikube which is working fine that means whenever DAG triggers it generates pod for every task in the tag and delete the pod after task completion.

Same i have in test Kubernetes env but when i trigger DAG there, it create the pod for first task in the DAG and that pod gets deleted immediately from the state like.. ContainerCreating -> Running - > Completed -> Error -> Terminating. Airflow UI have logs empty for that task so not able to check what caused the issue and rest of the dependent task fails automatically.

Here are the env variables i am using

AIRFLOW__CELERY__CELERY_CONCURRENCY:
1
AIRFLOW__CELERY__FLOWER_URL_PREFIX:
AIRFLOW__CELERY__WORKER_CONCURRENCY:
1
AIRFLOW__CODE__ENABLE_XCOM_PICKLING:
false
AIRFLOW__CORE__CATCHUP_BY_DEFAULT:
false
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION:
false
AIRFLOW__CORE__DAGS_FOLDER:
/usr/local/airflow/dags
AIRFLOW__CORE__DONOT_PICKLE:
false
AIRFLOW__CORE__EXECUTOR:
KubernetesExecutor
AIRFLOW__CORE__EXPOSE_CONFIG:
true
AIRFLOW__KUBERNETES__DAGS_VOLUME_CLAIM:
airflow-dags
AIRFLOW__KUBERNETES__LOGS_VOLUME_CLAIM:
airflow-logs
AIRFLOW__KUBERNETES__NAMESPACE:
cap
AIRFLOW__KUBERNETES__WORKER_CONTAINER_REPOSITORY:
repo/airflow-latest
AIRFLOW__KUBERNETES__WORKER_CONTAINER_TAG:
latest
AIRFLOW__KUBERNETES__WORKER_PODS_CREATION_BATCH_SIZE:
9
AIRFLOW__WEBSERVER__BASE_URL:
http://localhost:8080
DO_WAIT_INITDB:
false
FERNET_KEY:
FLOWER_PORT:
5555
POSTGRES_DB:
airflow
POSTGRES_HOST:
airflow-postgresql
POSTGRES_PORT:
5432
REDIS_HOST:
airflow-redis-master
REDIS_PORT:
-- user3531900
airflow
kubernetes

1 Answer

8/1/2019

you can add " AIRFLOW__KUBERNETES__DELETE_WORKER_PODS: false" environment variable and check pod logs

-- user2416
Source: StackOverflow