我尝试使用 Kubernetes Executor 执行 DAG,但 pod 无法启动并失败
ImagePullBackOff
stream logs failed container "base" in pod "dag-3-dry-run-demo-as2pjum1" is waiting to start: trying and failing to pull image for de │ry-run-demo-86tn0dxg ( │
│ fault/dag-3-dry-run-demo-as2pjum1 (base)
DAG代码
from datetime import datetime
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
def print_hello():
print("Hello world from first Airflow DAG!")
dag = DAG(
"dag_2",
description="Hello World DAG",
schedule_interval="0 12 * * *",
start_date=datetime(2017, 3, 20),
catchup=False,
)
hello_operator = PythonOperator(
task_id="hello_k8s", python_callable=print_hello, dag=dag, queue="kubernetes"
)
hello_operator
使用 this helm 来安装 AirFlow。
我这里缺少一些配置吗?
ImagePullBackOff
错误通常表示 Kubernetes 无法获取指定的容器镜像。
如 Engin Diri 的“Kubernetes: ImagePullBackOff!”和“排查 Kubernetes ImagePullBackOff”中所述,您需要查看此错误消息的可能原因:
imagePullPolicy
设置为允许 Kubernetes 拉取镜像的值。常见值为 Always
、IfNotPresent
和 Never
。