繁体   English   中英

AWS EKS fargate coredns ImagePullBackOff

[英]AWS EKS fargate coredns ImagePullBackOff

我正在尝试将一个简单的教程应用程序部署到基于 Fargate 的新 kubernetes 集群。

不幸的是,我被困在 coredns pod 的 ImagePullBackOff 上:

Events:
  Type     Reason           Age                  From               Message
  ----     ------           ----                 ----               -------
  Warning  LoggingDisabled  5m51s                fargate-scheduler  Disabled logging because aws-logging configmap was not found. configmap "aws-logging" not found
  Normal   Scheduled        4m11s                fargate-scheduler  Successfully assigned kube-system/coredns-86cb968586-mcdpj to fargate-ip-172-31-55-205.eu-central-1.compute.internal
  Warning  Failed           100s                 kubelet            Failed to pull image "602401143452.dkr.ecr.eu-central-1.amazonaws.com/eks/coredns:v1.8.0-eksbuild.1": rpc error: code = Unknown desc = failed to pull and unpack image "602

401143452.dkr.ecr.eu-central-1.amazonaws.com/eks/coredns:v1.8.0-eksbuild.1": failed to resolve reference "602401143452.dkr.ecr.eu-central-1.amazonaws.com/eks/coredns:v1.8.0-eksbuild.1": failed to do request: Head "https://602401143452.dkr.

ecr.eu-central-1.amazonaws.com/v2/eks/coredns/manifests/v1.8.0-eksbuild.1": dial tcp 3.122.9.124:443: i/o timeout
  Warning  Failed           100s                 kubelet            Error: ErrImagePull
  Normal   BackOff          99s                  kubelet            Back-off pulling image "602401143452.dkr.ecr.eu-central-1.amazonaws.com/eks/coredns:v1.8.0-eksbuild.1"
  Warning  Failed           99s                  kubelet            Error: ImagePullBackOff
  Normal   Pulling          87s (x2 over 4m10s)  kubelet            Pulling image "602401143452.dkr.ecr.eu-central-1.amazonaws.com/eks/coredns:v1.8.0-eksbuild.1"

在谷歌搜索时,我发现https://aws.amazon.com/premiumsupport/knowledge-center/eks-ecr-troubleshooting/它包含以下列表:

To resolve this error, confirm the following:

 - The subnet for your worker node has a route to the internet. Check the route table associated with your subnet.
 - The security group associated with your worker node allows outbound internet traffic.
 - The ingress and egress rule for your network access control lists (ACLs) allows access to the internet.

由于我手动创建了我的私有子网及其 NAT 网关,因此我试图在此处找到问题,但找不到任何东西。 它们以及安全组和 ACL 在我看来都很好。

在此处输入图像描述

我什至将 AmazonEC2ContainerRegistryReadOnly 添加到我的 EKS 角色中,但在发出命令kubectl rollout restart -n kube-system deployment coredns后,不幸的是结果是相同的: ImagePullBackOff

不幸的是,我的想法已经用完了,我被困住了。 任何可以帮助我解决此问题的帮助将不胜感激。 ~谢谢


编辑>

在@mreferre 在他的评论中建议通过 * eksctl创建新集群后,我收到带有链接的 RBAC 错误: https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting_iam.html#security-iam-troubleshoot-cannot -查看节点或工作负载
RBAC 错误

我不确定发生了什么,因为我已经有了我的 IAM 用户的完整政策


编辑>>

通过 AWS 控制台(web 接口)创建的集群没有配置映射aws-auth我使用命令kubectl edit configmap aws-auth -n kube-system检索了下面的配置映射

apiVersion: v1
data:
  mapRoles: |
    - groups:
      - system:bootstrappers
      - system:nodes
      - system:node-proxier
      rolearn: arn:aws:iam::370179080679:role/eksctl-tutorial-cluster-FargatePodExecutionRole-1J605HWNTGS2Q
      username: system:node:{{SessionName}}
kind: ConfigMap
metadata:
  creationTimestamp: "2021-04-08T18:42:59Z"
  name: aws-auth
  namespace: kube-system
  resourceVersion: "918"
  selfLink: /api/v1/namespaces/kube-system/configmaps/aws-auth
  uid: d9a21964-a8bf-49e9-800f-650320b7444e

创建一个答案来总结评论中认为可以接受的讨论。 设置具有 Fargate 支持的 EKS 集群的最常见(并且可以说更简单)的方法是使用EKSCTL并使用eksctl create cluster --fargate设置集群。 这将为您构建所有管道,您将获得一个没有 EC2 实例或托管节点组的集群,其中两个CoreDNS pod 部署在两个 Fargate 实例上。 请注意,当您通过命令行部署 EKSCTL 时,您最终可能会在 CLI 和控制台之间使用不同的角色/用户。 这可能会导致访问被拒绝问题。 最好的做法是使用非 root 用户登录 AWS 控制台并使用CloudShell通过 EKSCTL 进行部署(CloudShell 将继承相同的控制台用户身份)。 {评论中的更多信息}

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM