[英]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.