<p>On my local I run a <code>mysql</code> container and then ping it from another container on the same network:</p>

<pre><code>$ docker run -d tutum/mysql
$ docker run -it plumsempy/plum bash
    # ping MYSQL_CONTAINER_ID

      PING 67e35427d638 (198.105.244.24): 56 data bytes
      64 bytes from 198.105.244.24: icmp_seq=0 ttl=37 time=0.243 ms 
      ...
</code></pre>

<p>That is good. Then, using Kubernetes(minikube) locally, I deploy tutum/mysql using the following <code>YAML</code>:</p>

<pre><code>...
- name: mysql
  image: tutum/mysql
...
</code></pre>

<p>There is nothing else for the <code>mysql</code> container. Then I deploy it, ssh into the minikube pod, spin up a random container and try pinging the mysql container inside the pod this time:</p>

<pre><code>$ kubectl create -f k8s-deployment.yml
$ minikube ssh
    $ docker ps
    $ docker run -it plumsempy/plum bash
        # ping MYSQL_CONTAINER_ID_INSIDE_MINIKUBE

          PING mysql (198.105.244.24): 56 data bytes
          ^C--- mysql ping statistics ---
          10 packets transmitted, 0 packets received, 100% packet loss

        # traceroute MYSQL_CONTAINER_ID_INSIDE_MINIKUBE

          traceroute to aa7f7ed7af01 (198.105.244.24), 30 hops max, 60 byte packets
           1  172.17.0.1 (172.17.0.1)  0.031 ms  0.009 ms  0.007 ms
           2  10.0.2.2 (10.0.2.2)  0.156 ms  0.086 ms  0.050 ms
           3  * * *
           4  * * *
           5  dtr02gldlca-tge-0-2-0-1.gldl.ca.charter.com (96.34.102.201)  16.153 ms  16.107 ms  16.077 ms
           6  crr01lnbhca-bue-200.lnbh.ca.charter.com (96.34.98.188)  18.753 ms  18.011 ms  30.642 ms
           7  crr01mtpkca-bue-201.mtpk.ca.charter.com (96.34.96.63)  30.779 ms  30.523 ms  30.428 ms
           8  bbr01mtpkca-bue-2.mtpk.ca.charter.com (96.34.2.24)  24.089 ms  23.900 ms  23.814 ms
           9  bbr01ashbva-tge-0-1-0-1.ashb.va.charter.com (96.34.3.139)  26.061 ms  25.949 ms  36.002 ms
           10  10ge9-10.core1.lax1.he.net (65.19.189.177)  34.027 ms  34.436 ms  33.857 ms
           11  100ge12-1.core1.ash1.he.net (184.105.80.201)  107.873 ms  107.750 ms  104.078 ms
           12  100ge3-1.core1.nyc4.he.net (184.105.223.166)  100.554 ms  100.478 ms  100.393 ms
           13  xerocole-inc.10gigabitethernet12-4.core1.nyc4.he.net (216.66.41.242)  109.184 ms  111.122 ms  111.018 ms
           14  * * *
           15  * * * 
           ...(til it ends)
</code></pre>

<p>the <code>plumsempy/plum</code> can be any container since they are both on the same network and same pod, the pinging should go through. The question is <strong>Why can I not reach <code>mysql</code> on minikube and how could I fix that?</strong></p>

<p>From <a href="http://kubernetes.io/docs/user-guide/pods/multi-container/" rel="nofollow noreferrer">k8s multi-container pod docs</a>:</p>

<blockquote>
  <p>Pods share fate, and share some resources, such as storage volumes and IP addresses.</p>
</blockquote>

<p>Hence the <code>mysql</code> container is reachable from the <code>plum</code> container at the IP address <code>127.0.0.1</code>.</p>

<p>Also, since <code>mysql</code> runs on port 3306 by default, you probably want <code>telnet 127.0.0.1 3306</code> to check if it's reachable (<code>ping</code> uses ICMP which doesn't have the concept of ports).</p>
