dns - knative service is unable to open external url by name (explicit IP is ok) - Stack Overflow

admin2025-04-18  2

I have followed basic Knative setup recomended by official

So now i have:

  • minikube on WSL2
  • kourier
  • knative

After that I have simple python script on top of Flask to listen POST method and access external url like

Current observation:

  • Python script works well under docker dry-run;
  • Python script works if address specified by explicit IP: under Knative triggering by curl -X POST -H "host..." http:/127.0.0.1" -H "Content-Type: application/json" -d '{"url":"http://192.168.1.1"}'
  • Pythin script fails if url contains names aka curl -X POST -H "host..." http:/127.0.0.1" -H "Content-Type: application/json" -d '{"url":";}':

Failed to fetch URL: HTTPConnectionPool(host='example', port=80): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7fe471b0a900>: Failed to resolve 'example' ([Errno -5] Name has no usable address)"))"

What I have already tried to do:

  • Per official doc: networking.knative.dev/http-protocol: "enabled"
  • Also allow HTTP 1.1 duplex (don't think it is ever relevant).
    metadata:
      annotations:
        features.knative.dev/http-full-duplex: "Enabled"
转载请注明原文地址:http://anycun.com/QandA/1744920142a89492.html