Airflow CeleryKubernetesExecutor ImagePullBackOff - 未创建图像

问题描述 投票:0回答:1

我尝试使用 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。

我这里缺少一些配置吗?

kubernetes airflow minikube directed-acyclic-graphs airflow-k8s
1个回答
0
投票

您在 Kubernetes 中看到的

ImagePullBackOff
错误通常表示 Kubernetes 无法获取指定的容器镜像。

Engin Diri 的“Kubernetes: ImagePullBackOff!”和“排查 Kubernetes ImagePullBackOff”中所述,您需要查看此错误消息的可能原因:

  • 确保图像名称和标签正确。验证该映像是否存在于您正在使用的容器注册表中。
  • 如果映像位于私有注册表中,请确保 Kubernetes 具有访问它所需的凭据。您可能需要使用注册表凭据创建 Kubernetes Secret 并在 Airflow 配置中引用它。
  • 检查是否存在任何可能阻止 Kubernetes 访问容器注册表的网络策略或连接问题。
  • 检查容器注册表的状态以确保其正常运行。
  • 验证您的 Airflow 配置,尤其是与 Kubernetes Executor 和容器镜像相关的设置。检查 Helm 图表 值中是否有任何可能影响图像拉取过程的覆盖。
  • 确保
    imagePullPolicy
    设置为允许 Kubernetes 拉取镜像的值。常见值为
    Always
    IfNotPresent
    Never
© www.soinside.com 2019 - 2024. All rights reserved.