I have a AWS EKS cluster on which I have 2 pods running; one pod is a redis cache and the other is a GraphQL API. I also have a AWS RDS (mysql) instance which my GraphQL API is trying to communicate to.
However when I view the logs of the GraphQL API, this is the error I am receiving:
Error: connect ETIMEDOUT
at PoolConnection._handleTimeoutError (/app/node_modules/mysql2/lib/connection.js:189:17)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7) {
errorno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
fatal: true
}
The interesting thing is that I am able to successfully connect to the rds database from mysql workbench...
I am 67% sure that it is because of the way I have configured my security groups for the eks cluster.
Here is a screenshot of the inbound rules for the eks security group:
Here is a screenshot of the outbound rules for the eks security group:
Here is a screenshot of the inbound rules for the rds security group:
Here is a screenshot of the outbound rules for the rds security group:
Thanks for any help.
CodePudding user response:
In the RDS security group, you don't allow EKS to connect by MySQL protocol. What is the IP 175.34.53.139/32 mean? If they are in the same VPC, they will use private IP instead of public IP.