【问题标题】:AWS ALB Ingress has no host address and class is emptyAWS ALB Ingress 没有主机地址并且类为空
【发布时间】:2022-02-04 19:57:06
【问题描述】:

我已经按照 AWS 官方文档创建了一个 ALB 控制器,并确保在创建控制器时提供 aws region 和 vpc id 等一些事情。

https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html

但是,我在 ALB 控制器 pod 日志中注意到以下错误。我在 Fargate 节点中运行控制器 pod 和其他资源,AKS 在版本 1.21.0 上运行

{"level":"error","ts":1643650856.9675832,"logger":"controller-runtime.manager.controller.ingress","msg":"Reconciler error","name":"app- ingress","namespace":"backend","error":"WebIdentityErr: 检索凭据失败\n原因: RequestError: 发送请求失败\n原因: Post "https://sts.us-east-1.amazonaws .com/": dial tcp: i/o timeout"}

【问题讨论】:

  • 我发现了类似的错误。它在this link 下。您能否尝试将 coreDNS 配置为在 Fargate (documentation) 上运行?
  • 感谢@kkopczak,这是 ingress 的问题。在我执行更新 CoreDNS 部分中的命令后,它得到了解决。但是现在我有一个不同的问题。 Ingress 负载均衡器目标组是空的。
  • 我已经添加了一个答案。为了清楚起见,考虑将您的下一个问题添加到 StackOverflow 上的新问题中。

标签: amazon-web-services kubernetes kubernetes-ingress amazon-eks aws-application-load-balancer


【解决方案1】:

根据您的错误,您的 coreDNS 设置似乎不正确。

默认情况下,CoreDNS 配置为在 Amazon EKS 集群上的 Amazon EC2 基础设施上运行。如果您希望在集群中的 Fargate 上运行 pod,请完成以下步骤。

  1. 为 CoreDNS 创建 Fargate 配置文件。
aws eks create-fargate-profile \
    --fargate-profile-name coredns \
    --cluster-name [your cluster name] \
    --pod-execution-role-arn arn:aws:iam::[your account ID]:role/AmazonEKSFargatePodExecutionRole \
    --selectors namespace=kube-system,labels={k8s-app=kube-dns} \
    --subnets subnet-[1st ID of your private subnet] subnet-[2nd ID of your private subnet] subnet-[3rd ID of your private subnet]

AmazonEKSFargatePodExecutionRole 替换为您的 pod 执行角色的名称。如果您没有 pod 执行角色,则必须先create one

注意 角色 ARN 的格式必须为 arn:aws:iam::`111122223333`:role/`role-name`

  1. 以下命令从 CoreDNS pod 中删除 eks.amazonaws.com/compute-type : ec2 注释,运行它:
kubectl patch deployment coredns \
    -n kube-system \
    --type json \
    -p='[{"op": "remove", "path": "/spec/template/metadata/annotations/eks.amazonaws.com~1compute-type"}]'

Here is a link to the documentation.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-17
    • 2022-10-04
    • 1970-01-01
    • 2019-06-28
    • 2020-07-03
    • 2016-02-12
    • 2020-06-28
    • 2020-10-17
    相关资源
    最近更新 更多