【问题标题】:Airflow Kubernetes Executor not creating podsAirflow Kubernetes Executor 未创建 Pod
【发布时间】:2021-12-14 18:07:04
【问题描述】:

我正在尝试使用 Kubernetes Executor 为 Airflow 创建设置。但是,我遇到了一个问题,即 Airflow 在执行任务时无法创建 pod。然而,初始设置能够很好地创建组成部分。

有关气流值文件和 kubectl 资源的代码,请参阅 https://github.com/neku-dev-88/airflow_kubernetes

我在本地设置的方式是在命令提示符下安装以下步骤(Windows,我使用 kind:https://kind.sigs.k8s.io/):

  1. kind create cluster --image kindest/node:v1.18.15
  2. helm repo 添加气流稳定https://airflow-helm.github.io/charts
  3. kubectl apply -n airflow-staging -f roles.yaml
  4. helm install airflow-staging airflow-stable/airflow -f charts/airflow/values-staging.yaml --namespace airflow-staging

当我尝试运行 DAG 时,它只会停留在“运行”状态: in running status

我看到没有创建新的 pod: no new pods

我什至创建了一个气流服务角色,并使用了一个集群角色绑定给它一个集群角色来创建 Pod,但是没有运气。

值文件:

###################################
## CONFIG | Kubernetes ServiceAccount
###################################
serviceAccount:
  ## if a Kubernetes ServiceAccount is created
  ## - if `false`, you must create the service account outside this chart with name: `serviceAccount.name`
  ##
  create: true

  ## the name of the ServiceAccount
  ## - by default the name is generated using the `airflow.serviceAccountName` template in `_helpers/common.tpl`
  ##
  name: airflow

角色文件:

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: pods-permissions
rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "watch", "create", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: airflow-pods
  namespace: airflow-staging
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: pods-permissions
subjects:
  - kind: ServiceAccount
    name: airflow
    namespace: airflow-staging
---

我觉得我在设置中遗漏了一些东西,请指教。

【问题讨论】:

    标签: python kubernetes airflow etl kubernetes-helm


    【解决方案1】:

    我想通了,问题是我的 DAG 都已暂停,需要取消暂停。

    【讨论】:

      猜你喜欢
      • 2021-08-13
      • 2022-10-07
      • 1970-01-01
      • 2021-04-15
      • 2019-06-20
      • 1970-01-01
      • 2020-12-25
      • 2022-08-18
      • 2019-10-12
      相关资源
      最近更新 更多