EKS fargate profile Error: getaddrinfo EAI_AGAIN sts.us-east-2.amazonaws.com

0

Getting below error when running simple nodejs code to fetch a file from AWS s3 bucket. Running this code in an existing EKS cluster but in a new Fargate profile. This NodeJS code/image is working fine in two lower environments, but the pods are failing in one of the higher environment.

Tried almost everything what the Google world is suggesting, changed the nodejs base alpine image to latest but still same issue.

Same code/image is working fine if I deploy that in same existing EKS cluster but in a managed worker node, not sure why this is not working in Fargate profile. Also tried to delete the Fargate profile and recreated, but same issue. Also checked the sts VPC endpoint, Fargate pod execution role, security group and so on.. but no luck. Tried aws sdk to 3.438.0 and 3.441.0, but no success. Please help and suggest, what else can we try?

node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^

Error: getaddrinfo EAI_AGAIN sts.us-east-2.amazonaws.com
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
  errno: -3001,
  code: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'sts.us-east-2.amazonaws.com',
  '$metadata': { attempts: 1, totalRetryDelay: 0 }
}

Node.js v21.1.0
asked 6 months ago669 views
1 Answer
0

It is started working after modifying Security Group of worker node to allow inbound on port "53" UDP from Cluster Security Group. So that coreDNS pods are running on the EC2 nodes can resolve DNS queries of Fargate pods.

answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions