由于找不到PersistentVolumeClaim,具有Fargate窗格状态的AWS EKS处于挂起状态 [英] AWS EKS with Fargate pod status pending due to PersistentVolumeClaim not found

查看:213
本文介绍了由于找不到PersistentVolumeClaim,具有Fargate窗格状态的AWS EKS处于挂起状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用以下命令通过Fargate和alb-ingress-access部署了EKS集群:

I have deployed EKS cluster with Fargate and alb-ingress-access using the following command:

eksctl create cluster --name fargate-cluster --version 1.17 --region us-east-2 --fargate --alb-ingress-access

还创建了Fargate命名空间.

A Fargate namespace has also been created.

正在部署的应用程序具有四个容器,分别是mysql,nginx,redis和web.

The application being deployed has four containers namely mysql, nginx, redis and web.

YAML文件已应用于正确的名称空间.

The YAML files have been applied to the correct namespace.

我遇到的问题是,在获得豆荚状态后,应用YAML文件后,我会出现以下状态:

The issue I am having is that after applying the YAML files when I get the pods status I the following status:

NAMESPACE     NAME                              READY   STATUS    RESTARTS   AGE
flipkicks     flipkicksdb-7669b44bbb-xww26      0/1     Pending   0          112m
flipkicks     flipkicksredis-74bbf9bd8c-p59hb   1/1     Running   0          112m
flipkicks     nginx-5b46fd5977-9d8wk            0/1     Pending   0          112m
flipkicks     web-56666f5d8-64w4d               1/1     Running   0          112m

MySQL和Nginx Pod进入待处理状态.两者的部署YAML都具有以下volumeMounts值:

MySQL and Nginx pods go into pending status. The deployment YAML for both have the following volumeMounts values:

MYSQL

volumeMounts:
        - mountPath: /var/lib/mysql
          name: mysql-db

NGINX

volumeMounts:
        - mountPath: "/etc/nginx/conf.d"
          name: nginx-conf
        - mountPath: "/var/www/html"
          name: admin-panel

两个吊舱的kubectl describe命令的事件部分的输出为:

The output from the events part of the kubectl describe command for both pods is:

MYSQL

Events:
Type     Reason            Age        From               Message
----     ------            ----       ----               -------
Warning  FailedScheduling  <unknown>  fargate-scheduler  Pod not supported on Fargate: volumes not supported: mysql-db not supported because: PVC mysql-db not bound

NGINX

Events:
Type     Reason            Age        From               Message
----     ------            ----       ----               -------
Warning  FailedScheduling  <unknown>  fargate-scheduler  Pod not supported on Fargate: volumes not supported: admin-panel is of an unsupported volume Type

在理解此问题以及如何解决该问题方面将提供任何帮助,我们将非常感谢.

Would really appreciate any help in understanding this problem and how to resolve it.

推荐答案

由于您的NGINX和MYSQL吊舱需要 volumeMounts ,因此您将需要一个 PersistentVolumeClaim 用于从 PersistentVolume 资源进行存储.然后,您的Pod可以将声明用作卷,有关更多信息,请参见 Kubernetes持久卷.

Since your NGINX and MYSQL pods are requiring volumeMounts, you will need a PersistentVolumeClaim which is a request for storage from the PersistentVolume resource. Your pods can then use the claim as a volume, for more info see Kubernetes Persistent Volumes.

在最长的时间内,EKS Fargate直到

For the longest time EKS Fargate did not support persistent storage until Aug 17, 2020 when the AWS EFS CSI driver was introduced.

您将需要部署AWS EFS CSI驱动程序并更新清单以部署PersistentVolume,PersistentVolumeClaim,并使您的Pod将该声明用作卷.我建议从 Amazon EFS CSI驱动程序开始将CSI驱动程序部署到EKS Fargate集群并更新清单以匹配提供的示例的指南

You will need to deploy the AWS EFS CSI driver and update your manifests to deploy the PersistentVolume, PersistentVolumeClaim and get your pods to use the claim as a volume. I would suggest starting with the Amazon EFS CSI driver guide to deploy the CSI driver into your EKS Fargate cluster and update your manifests to match the examples provided here.

这篇关于由于找不到PersistentVolumeClaim,具有Fargate窗格状态的AWS EKS处于挂起状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆