<p>I'm trying to access remotely an AWS RDS Database instance running on private PVC through</p>
<blockquote>
<p>kubectl port-forward</p>
</blockquote>
<p>The RDS database public accessiblity is set to &quot;No&quot;,  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.</p>
<p>So far I have created below service</p>
<pre><code>kind: Service
metadata:
  name: postgres-service
spec:
  type: ExternalName
  externalName: xxx-xxx.xxxxxxx.eu-xx-1.rds.amazonaws.com
</code></pre>
<p>And below is the kubectl command that I have executed</p>
<pre><code>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
</code></pre>
<p>and the result I get is</p>
<pre><code>error: timed out waiting for the condition
</code></pre>

<p>If you dont want to use kubectl you can use postgress client pod setup in EKS cluster full time.</p>
<p>Or else you can run command like this :</p>
<pre><code>kubectl run postgresql-client --rm --tty -i --restart='Never' --namespace default --image bitnami/postgresql --env=&quot;PGPASSWORD=&lt;YOUR_PASSWORD&gt;&quot; --command -- psql --host &lt;YOUR_HOSTNAME=SVC_NAME_OR_IP&gt; -U &lt;HERE_USERNAME&gt; 
</code></pre>
<p>make sure you are using the proper namespace name and service name.</p>
<p>Both are in the same VPC means you can direct connect over internal address or IP without creating an external service.</p>
