設定容器的資源

可以為 Chart 管理的容器設定資源。您可以為不同的 Airflow k8s 容器定義不同的資源。預設情況下,資源未設定。

注意

k8s 排程器可以使用資源來決定將 Pod 放置在哪個節點上。由於 Pod 資源請求/限制是 Pod 中每個容器的資源請求/限制的總和,因此建議為 Pod 中的每個容器指定資源。

可以設定資源的可能容器包括

  • 主要的 Airflow 容器及其 Sidecar。您可以透過以下參數為這些容器新增資源

    • workers.resources

    • workers.logGroomerSidecar.resources

    • workers.kerberosSidecar.resources

    • workers.kerberosInitContainer.resources

    • scheduler.resources

    • scheduler.logGroomerSidecar.resources

    • dags.gitSync.resources

    • webserver.resources

    • flower.resources

    • dagProcessor.resources

    • dagProcessor.logGroomerSidecar.resources

    • triggerer.resources

    • triggerer.logGroomerSidecar.resources

  • 用於 Airflow k8s jobs 或 cron jobs 的容器。您可以透過以下參數為這些容器新增資源

    • cleanup.resources

    • createUserJob.resources

    • migrateDatabaseJob.resources

  • Chart 可以部署的其他容器。您可以透過以下參數為這些容器新增資源

    • statsd.resources

    • pgbouncer.resources

    • pgbouncer.metricsExporterSidecar.resources

    • redis.resources

例如,為 worker Kerberos sidecar 指定資源

workers:
  kerberosSidecar:
    resources:
      limits:
        cpu: 200m
        memory: 256Mi
      requests:
        cpu: 100m
        memory: 128Mi

這個條目對您有幫助嗎?