Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpGet on liveness probes broken: inability to address pod's IP in NetAction? #208

Open
sthetz opened this issue Mar 5, 2018 · 2 comments

Comments

@sthetz
Copy link

sthetz commented Mar 5, 2018

Hello!

After converting my Kubernetes configs into Short format I noticed that my container with a Rails web app started failing liveness/readiness checks. Quick investigation revealed that the problem is default value of host in httpGet.

Here is the probe part of the original Kubernetes config:

livenessProbe:
  httpGet:
    path: /status/online
    port: 3000

When run through Short, it translates into this:

liveness_probe:
  net:
    url: HTTP://localhost:3000/status/online

Which in turn (when translated back into Kubernetes format) translates into this:

livenessProbe:
  httpGet:
    host: localhost
    path: /status/online
    port: 3000
    scheme: HTTP

So, Short adds explicit param host which defaults to localhost. However, Kubernetes documentation on probes states that the host param in httpGet defaults to pod's internal IP. So when liveness probe tries to access localhost instead of pod's IP, the probe fails.

@sthetz
Copy link
Author

sthetz commented Mar 5, 2018

I found out that to avoid creating host: localhost line in Kubernetes config I have to simply remove the host from Short config, like this:

liveness_probe:
    delay: 15
    net:
      url: HTTP://:3000/status/online

@sthetz sthetz closed this as completed Mar 5, 2018
@wlan0
Copy link
Member

wlan0 commented Mar 5, 2018

Glad it worked out! Feel free to add any other issues if you face them!

The issue you've mentioned should be fixed, since it deviates from kube-api spec. I'll reopen it so that we can track it.

@wlan0 wlan0 reopened this Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants