<p>I have a POD running which had a Java Application running. This Java Application talks to a MySql which is on-prem. The MySql accepts connections from 192.* ip's
I  have the pod running on EKS worker nodes with Ip - 192.<em>. I am able to telnet Mysql from the worker nodes. When the pod starts, the Java application tries to connect to the Mysql with the POD  Ip  (which is some random 172.</em> ip) and fails with MySQL connection error. 
How can I solve this?</p>

Gowtham Kumar Madipuri
<p>Try to execute a shell inside the pod and connect to the MySQL server from there.</p>

<pre><code>kubectl exec -it -n &lt;namespace-name&gt; &lt;pod-name&gt; -c &lt;container-name&gt; -- COMMAND [args...]
</code></pre>

<p>E.g.:</p>

<pre><code>kubectl exec -it -n default mypod -c container1 -- bash
</code></pre>

<p>Then check the MySQL connectivity:</p>

<pre><code>#/&gt; mysql --host mysql.dns.name.or.ip --port 3306 --user root --password --verbose
</code></pre>

<p>Or start another pod with usual tools and check MySQL port connectivity:</p>

<pre><code>$ kubectl run busybox --rm -it --image busybox --restart=Never

#/&gt; ping mysql.dns.name.or.ip
#/&gt; telnet mysql.dns.name.or.ip 3306
</code></pre>

<p>You should see some connection-related information that helps you to resolve your issue.</p>

<p>I can guess you just need to add a route to your cluster pods network on your MySQL host or its default network router.</p>
