AWS ALB Ingress 没有主机地址并且 class 为空

AWS ALB Ingress has no host address and class is empty

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

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

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

上使用 AKS 运行

{"level":"error","ts":1643650856.9675832,"logger":"controller-runtime.manager.controller.ingress","msg":"Reconciler error","name":"app-ingress","namespace":"backend","error":"WebIdentityErr: failed to retrieve credentials\ncaused by: RequestError: send request failed\ncaused by: Post "https://sts.us-east-1.amazonaws.com/": dial tcp: i/o timeout"}

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

By default, CoreDNS is configured to run on Amazon EC2 infrastructure on Amazon EKS clusters. If you want to only run your pods on Fargate in your cluster, complete the following steps.

  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

NOTE The format of the role ARN must be arn:aws:iam::`111122223333`:role/`role-name` .

  1. 以下命令从 CoreDNS pods、运行 中删除 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.