【问题标题】:Allocate memory request and limit for the pods that airflow will create to run tasks in kubernetes为气流将创建以在 kubernetes 中运行任务的 pod 分配内存请求和限制
【发布时间】:2021-01-29 01:04:27
【问题描述】:

我已经使用 helm stable/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 使用的内存和 cpu 限制。我可以看到我可以限制工人的资源。

我的问题是:

如何指定内存请求,以及将从工作人员创建的 pod 的限制?因为我只能看到如何从工作人员那里设置资源,而不能看到工作人员创建的 Pot。

【问题讨论】:

    标签: kubernetes airflow kubernetes-helm


    【解决方案1】:

    我认为您可能将 Celery Executor 与 Kubernetes Executor 混为一谈。 Kubernetes Executor 为每个任务实例创建一个新的 pod。使用 Celery Executor,您将获得预设数量的工作 pod 来运行您的任务。例如,您可以提前设置工作人员数量here。在这种情况下,设置 these values 应该为您的工作 pod 提供您需要的资源。他们的 README 中有很好的例子,说明了如果您需要动态缩放,您可以如何利用它。

    【讨论】:

      【解决方案2】:

      您可以通过修改 helm chart 中的values.yaml 来指定调度程序的资源。

      您可以通过在本地拉动图表来做到这一点,例如运行:

      helm fetch --untar stable/airflow
      

      然后修改scheduler:resources中的values.yaml文件,例如:

       163 scheduler:
       164   resources:
       165      requests:
       166        cpu: "100m"
       167        memory: "1Gi"
       168      limits:
       169        cpu: "100m"
       170        memory: "1Gi"
      

      然后安装图表helm install airflow . 指定的资源将分配给pods。

      【讨论】:

      • 调度器资源不是要指定调度器pod吗?此资源规范是否也适用于将由工作人员创建的 pod?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-21
      • 2021-07-02
      • 1970-01-01
      • 2019-08-20
      • 2020-05-22
      • 1970-01-01
      • 2020-01-05
      相关资源
      最近更新 更多