I'm trying to access remotely an AWS RDS Database instance running on private PVC through
kubectl port-forward
The RDS database public accessiblity is set to "No", also I have an EKS cluster running on the same RDS PVC, the pods and services of EKS are able to communicate with AWS RDS.
So far I have created below service
kind: Service
metadata:
name: postgres-service
spec:
type: ExternalName
externalName: xxx-xxx.xxxxxxx.eu-xx-1.rds.amazonaws.com
And below is the kubectl command that I have executed
kubectl run -it --rm --image=postgres postgres-client -- postgres-service --host=xx-xx.xx.eu-west-1.rds.amazonaws.com --port=5432 --username=xxx --password=xxx --dbname=xxx
and the result I get is
error: timed out waiting for the condition