Knative pod http request

1/7/2019

When I make request for this started server: https://gist.github.com/Rasarts/1180479de480d7e36d6d7aef08babe59#file-server

I get right response:

{
  "args": {}, 
  "headers": {
    "Accept-Encoding": "gzip", 
    "Connection": "close", 
    "Host": "httpbin.org", 
    "User-Agent": "Go-http-client/1.1"
  }, 
  "origin": "", 
  "url": "https://httpbin.org/get"
}

But when I make request to that server on minikube which was created this way: https://gist.github.com/Rasarts/1180479de480d7e36d6d7aef08babe59#file-serve-yaml

I get error:

ERROR: Get https://httpbin.org/get: EOF<nil>

How can I make http requests from kubernetes pod?

-- Vitaliy Vostrikov
go
knative
kubernetes

1 Answer

1/8/2019

Knative uses Istio and Istio, by default, doesn't allow outbound traffic to external hosts, such as httpbin.org. That's why your request is failing.

Follow this document to learn how to configure Knative (so that it configures Istio correctly) to make outbound connections. Or, you can directly configure the Istio by adding an egress policy: https://istio.io/docs/tasks/traffic-management/egress/

-- AhmetB - Google
Source: StackOverflow