<p><strong>Some quick background:</strong> creating an app in golang, running on minikube on MacOS 10.14.2</p>

<pre><code>karlewr [0] $ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-18T11:37:06Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.4", GitCommit:"f49fa022dbe63faafd0da106ef7e05a29721d3f1", GitTreeState:"clean", BuildDate:"2018-12-14T06:59:37Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

<p><strong>The Issue:</strong>
I cannot access my pod via it's pod IP from inside my cluster. This problem is only happening with this one pod which leads me to believe I have a misconfiguration somewhere.</p>

<p>My pods spec is as follows:</p>

<pre><code>containers:
  - name: {{ .Chart.Name }}
    image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
    ports:
      - name: http
        containerPort: 8080
        protocol: TCP
    livenessProbe:
      httpGet:
        path: /ping
        port: 8080
      initialDelaySeconds: 60
    readinessProbe:
      httpGet:
        path: /ping
        port: 8080
      initialDelaySeconds: 60
</code></pre>

<p>What's weird is that I can access it by port-forwarding that pod on port <code>8080</code> and running <code>curl localhost:8080/ping</code> before the liveness and readiness probes run and after the pod has been initialized. This returns 200 OK.</p>

<p>Also during this time before <code>CrashLoopBackoff</code>, if I ssh into my minikube node and run <code>curl http://172.17.0.21:8080/ping</code> I get <code>curl: (7) Failed to connect to 172.17.0.21 port 8080: Connection refused</code>. The IP used is my pod's IP.</p>

<p>But then when I describe the pod after the <code>initialDelaySeconds</code> period, I see this:</p>

<pre><code>  Warning  Unhealthy  44s (x3 over 1m)  kubelet, minikube  Readiness probe failed: Get http://172.17.0.21:8080/ping: dial tcp 172.17.0.21:8080: connect: connection refused
  Warning  Unhealthy  44s (x3 over 1m)  kubelet, minikube  Liveness probe failed: Get http://172.17.0.21:8080/ping: dial tcp 172.17.0.21:8080: connect: connection refused
</code></pre>

<p>Why would my connection be getting refused only from the pod's IP?</p>

<p><strong>Edit</strong> I am not running any custom networking things, just minikube out of the box</p>

rkarlewicz
<blockquote>
  <p>Why would my connection be getting refused only from the pod's IP?</p>
</blockquote>

<p>Because your program is apparently only listening on localhost (aka <code>127.0.0.1</code> aka <code>lo0</code>)</p>

<p>Without knowing more about your container we can't advise you further, but that's almost certainly the problem based on your description.</p>
