【问题标题】:Airflow KubernetesPodOperator AirflowException('Pod Launching failed: {error}'.format(error=ex))Airflow KubernetesPodOperator AirflowException('Pod Launching failed: {error}'.format(error=ex))
【发布时间】:2023-03-17 18:07:01
【问题描述】:

我正在运行一个 KubernetesPodOperator,它带有一个使用 microk8s 导入的自定义 docker 镜像。在气流中运行 DAG 时,我会看到以下日志,直到收到超时消息 AirflowException('Pod Launching failed: {error}'.format(error=ex))

[2020-04-14 23:06:39,875] {logging_mixin.py:95} INFO - [[34m2020-04-14 23:06:39,875[0m] {[34mpod_launcher.py:[0m141} INFO[0m - Event: [1mk8s-pod-ml-3a541375[0m had an event of type [1mPending[0m[0m

搜索我在 ubuntus 终端上运行 microk8s kubectl get pods 的问题并得到:

正如您所见,pod 的名称在日志中几乎完全相同(除了开头的 1m),但状态为 ErrImageNeverPull。除了this 说'KubernetesPodOperator 的默认超时时间是 120 秒,这可能导致在下载更大的图像之前发生超时,我在实习生中找不到任何关于该状态或错误的信息。 ' 我将默认超时更改为 600 秒,但没有用。

【问题讨论】:

  • 这能回答你的问题吗? Getting "ErrImageNeverPull" in pods
  • @mdaniel 我之前看到过,但不是因为我没有在 VM 中运行,我没有使用 minikube 并且docker-env 不是 microk8s 的子命令
  • 只需尝试将 imagePullPolicy: Never 添加到您的 pod 规范中,然后告诉我们它是否有效。
  • @HelloWorld 老实说不知道在哪里添加 microk8s 的配置文件与该线程中显示的不同

标签: kubernetes airflow ubuntu-18.04 microk8s


【解决方案1】:

问题

Microk8s 无法访问 docker。我通过运行microk8s.inspect 并获取

WARNING:  Docker is installed. 
File "/etc/docker/daemon.json" does not exist. 
You should create it and add the following lines: 
{
    "insecure-registries" : ["localhost:32000"] 
}

and then restart docker with: sudo systemctl restart docker
Building the report tarball
  Report tarball is at /var/snap/microk8s/1320/inspection-report-20200415_141500.tar.gz

按照警告说气流设法在吊舱中部署图像。

【讨论】:

    猜你喜欢
    • 2022-12-19
    • 2021-05-14
    • 2021-11-28
    • 1970-01-01
    • 2012-07-28
    • 2022-12-29
    • 2014-07-17
    • 2020-05-28
    • 1970-01-01
    相关资源
    最近更新 更多