Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Dns resolution problem with Alpine and Kubernetes #65

Closed
TLmaK0 opened this issue Dec 30, 2021 · 6 comments
Closed

Dns resolution problem with Alpine and Kubernetes #65

TLmaK0 opened this issue Dec 30, 2021 · 6 comments

Comments

@TLmaK0
Copy link

TLmaK0 commented Dec 30, 2021

After version 7.77 curl is not able to resolve hosts:

kubectl run --restart Never --image curlimages/curl:7.80.0 curl -- domain.com
kubectl logs curl

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: domain.com

kubectl delete pod curl
kubectl run --restart Never --image curlimages/curl:7.77.0 curl -- domain.com
kubectl logs curl

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
100   162  100   162    0     0    295      0 --:--:-- --:--:-- --:--:--   295

I think this is due to problems with Alpine and Kubernetes dns reported, like this: https://www.openwall.com/lists/musl/2018/03/30/7

@xquery
Copy link
Member

xquery commented Jan 9, 2022

it seems like you are resolving to a 301 - to instruct curl to follow redirects you need to provide the -L option

@xquery xquery closed this as completed Jan 9, 2022
@TLmaK0
Copy link
Author

TLmaK0 commented Jan 10, 2022

@xquery I think you didn't understand correctly the problem. If you look at the first request you will see a curl: (6) Could not resolve host: domain.com which is not correct, but if you do the same with other curl version it works as expected.

@xquery
Copy link
Member

xquery commented Jan 10, 2022

I think I understand your problem - was reading things wrong way around ;)

doing

docker run curlimages/curl:7.77.0 -v -- domain.com

vs

docker run curlimages/curl:7.81.0 -v -- domain.com

seeing same output, trying to repro in Kubernetes

@TLmaK0
Copy link
Author

TLmaK0 commented Jan 10, 2022

@djhoese
Copy link

djhoese commented May 19, 2022

It seems this was closed before the problem was identified. Are there any suggestions for what someone who wants to use these images should do when running on a Kubernetes cluster and getting these DNS "Could not resolve" errors?

@TLmaK0
Copy link
Author

TLmaK0 commented May 20, 2022

@djhoese the only way I found is to downgrade to curl 7.77

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants