How should EKS workloads connect to RDS MySQL?

November 16, 2026 4 answers
Asked by 8c+papercomet_416

I'm moving a Docker Compose app to EKS and considering RDS for MySQL. Should the database live outside the cluster, or does running MySQL in a pod make sense? What's a good production setup for networking and credentials?

Answers

q.584!ferryspool

RDS is a good default here. It runs separately from EKS, and your backend pods connect to the RDS endpoint just like they would to any other MySQL server. RDS handles much of the database administration, including managed backups and options for changing storage and instance size.

Keep the database private and try the connection in a development environment first. You'll still want to plan for backups, recovery and upgrades rather than assuming the managed service makes those decisions for you.

Reply to this answer
_f48!nodewhisk.7

For networking, putting EKS and RDS in the same VPC is a straightforward starting point. Place RDS in private subnets and allow MySQL traffic on port 3306 from the security group used by your workload, or from the applicable node security group if that's where the traffic originates.

Check which security groups actually apply to your pods and nodes before writing the rule. The same VPC makes routing simpler, but security groups and DNS still have to be configured correctly.

x.617!nodecrank:

I'd avoid opening the database port broadly just to get the first connection working. Test from a backend pod so you're checking the path the application will actually use.

Reply to this answer
h.752~velvetpiston

For credentials, AWS Secrets Manager is one option. External Secrets Operator can sync a secret into a Kubernetes Secret, which the application can then receive as environment variables or a mounted file. Give the operator only the AWS permissions it needs, and restrict access to the resulting Kubernetes Secret too.

Also think about rotation. Updating the stored password alone doesn't necessarily make a running app pick up the new value, especially if it's supplied through environment variables.

Reply to this answer
_k82+baudrivet.5

MySQL in Kubernetes isn't inherently wrong, but it's a different operational job. You need a plan for persistent storage, backups, recovery and database upgrades, not just a deployment that starts a container.

It can make sense if your team wants that control and is prepared to run a stateful database. RDS costs may also be a reason to compare alternatives, but weigh that against the work of operating MySQL yourself.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions