title: k8s pod readiness probe fails with connection refused, but pod is serving requests just fine
body: <p>I'm having a hard time understanding why a pods readiness probe is failing.</p>
  
  <pre><code>  Warning  Unhealthy  21m (x2 over 21m)  kubelet, REDACTED  Readiness probe failed: Get http://192.168.209.74:8081/actuator/health: dial tcp 192.168.209.74:8081: connect: connection refused
  </code></pre>
  
  <p>If I exec into this pod (or in fact into any other I have for that application), I can run a curl against that very URL without issue:</p>
  
  <pre><code>kubectl exec -it REDACTED-l2z5w /bin/bash
  $ curl -v http://192.168.209.74:8081/actuator/health
  $ curl -v http://192.168.209.74:8081/actuator/health
  * Expire in 0 ms for 6 (transfer 0x5611b949ff50)
  *   Trying 192.168.209.74...
  * TCP_NODELAY set
  * Expire in 200 ms for 4 (transfer 0x5611b949ff50)
  * Connected to 192.168.209.74 (192.168.209.74) port 8081 (#0)
  &gt; GET /actuator/health HTTP/1.1
  &gt; Host: 192.168.209.74:8081
  &gt; User-Agent: curl/7.64.0
  &gt; Accept: */*
  &gt; 
  &lt; HTTP/1.1 200 
  &lt; Set-Cookie: CM_SESSIONID=E62390F0FF8C26D51C767835988AC690; Path=/; HttpOnly
  &lt; X-Content-Type-Options: nosniff
  &lt; X-XSS-Protection: 1; mode=block
  &lt; Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  &lt; Pragma: no-cache
  &lt; Expires: 0
  &lt; X-Frame-Options: DENY
  &lt; Content-Type: application/vnd.spring-boot.actuator.v3+json
  &lt; Transfer-Encoding: chunked
  &lt; Date: Tue, 02 Jun 2020 15:07:21 GMT
  &lt; 
  * Connection #0 to host 192.168.209.74 left intact
  {"status":"UP",...REDACTED..}
  </code></pre>
  
  <p>I'm getting this behavior from both a Docker-for-Desktop k8s cluster on my Mac as well as an OpenShift cluster.</p>
  
  <p>The readiness probe is shown like this in kubectl describe:</p>
  
  <pre><code>    Readiness:  http-get http://:8081/actuator/health delay=20s timeout=3s period=5s #success=1 #failure=10
  </code></pre>
  
  <p>The helm chart has this to configure it:</p>
  
  <pre><code>    readinessProbe:
        failureThreshold: 10
        httpGet:
          path: /actuator/health
          port: 8081
          scheme: HTTP
        initialDelaySeconds: 20
        periodSeconds: 5
        successThreshold: 1
        timeoutSeconds: 3
  </code></pre>
  
  <p>I cannot fully rule out that HTTP proxy settings are to blame, but the k8s docs say that HTTP_PROXY is ignored for checks since v1.13, so it shouldn't happen locally.</p>
  
  <p>The OpenShift k8s version is 1.11, my local one is 1.16.</p>