简体   繁体   English

如何将 EFS 添加到 Amazon-EKS 上的 Airflow 部署?

[英]How can I add EFS to an Airflow deployment on Amazon-EKS?

Kube.netes and EKS newbie here. Kube.netes 和 EKS 新手在这里。

I've set up an Elastic Kube.netes Service (EKS) cluster and added an Airflow deployment on top of it using the official HELM chart for Apache Airflow .我已经设置了一个 Elastic Kube.netes 服务 (EKS) 集群,并使用 Apache Airflow 的官方 HELM 图表在其上添加了一个 Airflow 部署。 I configured gitsync and can successfully run my DAGS.我配置了 gitsync 并且可以成功运行我的 DAGS。 For some of the DAGs, I need to save the data to an Amazon EFS.对于某些 DAG,我需要将数据保存到 Amazon EFS。 I installed the Amazon EFS CSI driver on eks following the instruction on the amazon documentation .我按照 亚马逊文档中的说明在 eks 上安装了 Amazon EFS CSI 驱动程序。

Now, I can create a new pod with access to the NFS but the airflow deployment broke and stay in a state of Back-off restarting failed container .现在,我可以创建一个可以访问 NFS 的新 pod,但是 airflow 部署中断并停留在 state 的Back-off restarting failed container I also got the events with kubectl -n airflow get events --sort-by='{.lastTimestamp} and I get the following messages:我还使用kubectl -n airflow get events --sort-by='{.lastTimestamp}了事件,我收到了以下消息:

TYPE      REASON               OBJECT                                            MESSAGE

Warning   BackOff              pod/airflow-scheduler-599fc856dc-c4pgz            Back-off restarting failed container

Normal    FailedBinding        persistentvolumeclaim/redis-db-airflow-redis-0    no persistent volumes available for this claim and no storage class is set

Warning   ProvisioningFailed   persistentvolumeclaim/ebs-claim                   storageclass.storage.k8s.io "ebs-sc" not found

Normal    FailedBinding        persistentvolumeclaim/data-airflow-postgresql-0   no persistent volumes available for this claim and no storage class is set

I have tried this on EKS version 1.22.我已经在 EKS 版本 1.22 上尝试过这个。

I understand from this that airflow is expecting to get an EBS volume for its pods but the NFS driver changed the configuration of the pvs.我从中了解到 airflow 期望为其 pod 获取 EBS 卷,但 NFS 驱动程序更改了 pvs 的配置。

The pvs before I install the driver are this:我安装驱动前的pvs是这样的:

NAME CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM STORAGECLASS   REASON   AGE
pvc-######   100Gi      RWO            Delete           Bound    airflow/logs-airflow-worker-0       gp2                     1d

pvc-######   8Gi        RWO            Delete           Bound    airflow/data-airflow-postgresql-0   gp2                 1d

pvc-######   1Gi        RWO            Delete           Bound    airflow/redis-db-airflow-redis-0    gp2                     1d

After I install the EFS CSI driver, I see the pvs have changed.安装 EFS CSI 驱动程序后,我看到 pvs 发生了变化。

NAME      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM STORAGECLASS   REASON   AGE

efs-pvc   5Gi        RWX            Retain           Bound    efs-storage-claim   efs-sc                  2d

I have tried deploying airflow before or after installing the EFS driver and in both cases I get the same error.我曾尝试在安装 EFS 驱动程序之前或之后部署 airflow,在这两种情况下我都会遇到相同的错误。

How can I get access to the NFS from within Airflow without breaking the Airflow deployment on EKS.如何在不破坏 EKS 上的 Airflow 部署的情况下从 Airflow 访问 NFS。 Any help would be appreciated.任何帮助,将不胜感激。

As stated in the error above no persistent volumes available for this claim and no storage class is set and storageclass.storage.k8s.io "ebs-sc" not found , you have to deploy a storage class called efs-sc using the EFS CSI driver as a provisioner.如上面的错误所述, no persistent volumes available for this claim and no storage class is set并且storageclass.storage.k8s.io "ebs-sc" not found ,您必须使用 EFS CSI 部署名为efs-sc的存储 class司机作为供应商。

Further documentation could be found here可以在此处找到更多文档

An example of creating your missing storage class and persistent volume could be found here可以在此处找到创建丢失的存储 class 和持久卷的示例

These steps are also described in the AWS EKS user guide AWS EKS 用户指南中也描述了这些步骤

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何理解 EKS Fargate 中的“节点”? - How can I understand `Nodes` in EKS Fargate? 如何将 MixInstancesPolicies 应用于 EKS spot 托管节点组? - How can I apply MixInstancesPolicies to EKS spot managed node group? 在 Amazon eks 中 - 如何查看 eks fargate 节点创建之前的日志以及 pod 启动时的日志 - In amazon eks - how to view logs which are prior to eks fargate node creation and logs while pods is starting up 如何将 static IP 分配给我的 EKS 服务? - How can I assign a static IP to my EKS service? EKS 上的 Airflow 是否需要 Trigger Pod - Is Triggerer Pod needed for Airflow on EKS Helm EKS Fargate + EFS:未绑定 PVC,但 pod 重启有帮助 - Helm EKS Fargate + EFS: PVC not bound, but pod restart helps 如何将 Amazon SES 与 Ghost 结合使用? - How can I use Amazon SES with Ghost? 如何建立基于 gRPC 的服务连接,在 EKS 上部署为容器化微服务? - How can I make a connection for service based on gRPC deployed as containerised microservices on EKS? 我如何通过 nginx 入口 controller 公开我的 EKS 微服务 - How can i expose my EKS microservices via nginx ingress controller 无法使 airflow AWS 连接工作“ModuleNotFoundError:没有名为‘airflow.providers.amazon’的模块” - Can't get airflow AWS connection to work "ModuleNotFoundError: No module named 'airflow.providers.amazon"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM