在 EKS 上使用 Fargate时,服务卡在“pending”状态

0

【以下的问题经过翻译处理】 你好! 我创建了一个简单的集群和一个带有服务的简单部署(见下文)。


eksctl create cluster --name artem-cluster --region eu-west-1 --fargate --profile mfa


apiVersion: apps/v1 kind: Deployment metadata: name: sample-app spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers:

  • name: nginx image: public.ecr.aws/nginx/nginx:1.19.6 ports:
  • name: http containerPort: 80

apiVersion: v1 kind: Service metadata: name: sample-service annotations: service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip spec: ports:

  • port: 80 targetPort: 80 protocol: TCP type: LoadBalancer selector: app: nginx

但服务停留在 <pending> 状态 - 示例服务 LoadBalancer 10.100.5.193 <pending> 80:31505/TCP 5h57m 在“描述”中,我看到了唯一的字符串: Type Reason Age From Message


Normal EnsuringLoadBalancer 29m service-controller Ensuring load balancer


顺便说一下,如果我在没有“service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip”的情况下创建服务,它创建成功,但是

curl <external_ip>:80 返回空响应,所以我在文档中发现我应该使用“nlb-ip”,现在坚持使用它。

profile picture
专家
已提问 5 个月前17 查看次数
1 回答
0

【以下的回答经过翻译处理】 哎,在这个例子中我没有仔细阅读先决条件,也没有设置 AWS Load Balancer Controller。这需要创建一个 ALB 或 NLB 目标 IP(如 Fargates 案例)。我按照这里的步骤操作:https://aws.amazon.com/premiumsupport/knowledge-center/eks-alb-ingress-controller-fargate/

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则