AWS EKS: how to to Connect to RDS from Pods Due to Security Group Issues
I'm integrating two systems and I tried several approaches but none seem to work... I'm currently working with a scenario with my AWS EKS setup where the pods are unable to connect to an RDS instance. I've verified that the RDS instance is in the same VPC as my EKS cluster, but I keep getting a timeout behavior when attempting to connect. The behavior I'm working with is `Failed to connect to database: connection timed out`. I've ensured that the security group attached to my RDS instance allows inbound traffic from the security group associated with my EKS nodes. The relevant RDS security group rule looks like this: ```plaintext Type: MySQL/Aurora Protocol: TCP Port: 3306 Source: sg-xxxxxxxx (EKS Node SG) ``` However, my pod's security context is configured like this: ```yaml apiVersion: v1 kind: Pod metadata: name: my-app spec: containers: - name: my-app-container image: my-app-image env: - name: DB_HOST value: my-rds-endpoint.amazonaws.com - name: DB_PORT value: '3306' ``` Iβve also double-checked the IAM roles and permissions, ensuring that the EKS worker nodes have the necessary access to communicate with the RDS service. Still, I canβt seem to pinpoint the scenario. I even tried using the `kubectl exec` command to enter the pod and use `telnet` to connect to the RDS endpoint, but it times out as well. Could this be a question with networking or the setup of the security groups? Any insights or troubleshooting steps would be greatly appreciated. How would you solve this? This issue appeared after updating to Yaml latest. I'm open to any suggestions. I'm coming from a different tech stack and learning Yaml.