我已经使用 helm stable/airflow 部署了 Airflow :https://github.com/helm/charts/tree/master/stable/airflow
我已经用 celery executor 部署了它,并且我运行了一个需要读取大表的任务。我在运行此任务的 Pod 中收到此错误:
The node was low on resource: memory. Container base was using 3642536Ki, which exceeds its request of 0.
I understand that I have exceed the memory of the node is running this pod.
我想修改每个 pod 在 airflow 中使用的内存和 cpu 的限制。我可以看到我可以限制 worker 的资源。
我的问题是:
我如何指定内存请求,以及要从 worker 创建的 pod 的限制?因为我只能看到如何设置 worker 的资源,而看不到 worker 创建的 Pots。
最佳答案
我认为您可能将 Celery Executor 与 Kubernetes Executor 混为一谈. Kubernetes Executor 为每个任务实例创建一个新的 pod。使用 Celery Executor,您将获得预设数量的 worker pod 来运行您的任务。例如,您可以预先设置 worker 数量 here .在这种情况下,设置 these values应该为您的 worker pod 提供您需要的资源。他们的 README 提供了一个很好的示例,说明如果您需要的话,可以如何利用动态缩放。
关于kubernetes - 为 Airflow 将创建的 pod 分配内存请求和限制以在 kubernetes 中运行任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64356443/