origin
origin copied to clipboard
oc adm diagnostics doesn't work behind proxy
Hello,
it looks like oc adm diagnostics completely ignores no_proxy variable even if it's defined... It's freshly installed cluster.
openshift_no_proxy: .cluster.local,localhost,127.0.0.1,10.128.0.0/14,172.30.0.0/16,.nip.io,docker-registry.default.svc.cluster.local,docker-registry.default.svc,192.168.100.0/24
Version
oc v3.9.0+191fece kubernetes v1.9.1+a0ce1bc657 features: Basic-Auth GSSAPI Kerberos SPNEGO
Steps To Reproduce
- deploy behind proxy
- run
oc adm diagnostics
Current Result
...
debug: 11:39:54.566: waiting 500ms for an HTTP response from http://172.30.95.254:8080/
debug: 11:39:55.067: Request to http://172.30.95.254:8080/ returned an error or timed out in 500.266171ms: Get http://172.30.95.254:8080/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
debug: 11:39:55.067: waiting 500ms for an HTTP response from http://172.30.95.254:8080/
debug: 11:39:55.567: Request to http://172.30.95.254:8080/ returned an error or timed out in 500.501176ms: Get http://172.30.95.254:8080/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
ERROR: [DCluAC019 from diagnostic AppCreate@openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster/app_create/service.go:129]
11:39:55.567: Request to service http://172.30.95.254:8080/ with timeout 500ms failed after 11 tries.
Last error was: Get http://172.30.95.254:8080/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
Diagnostics attempted to connect to the service address for the test application,
expecting to receive a successful response with HTTP code 200. This did not happen
within the given timeout.
Some of the reasons why this may fail include:
* The host running this diagnostic is not part of the cluster SDN
(try running from a master, or skip the service connection test)
* The pod stopped or was killed after starting successfully (check pod/node logs)
* The pod is responding with a non-200 HTTP code (or, not quickly enough / at all)
* Cluster networking problems prevent connecting to the service
Verify
oc ex diagnostics appcreate --loglevel=10 --diaglevel=0 --keep-app=true
[root@master ~]# curl --noproxy "*" -vk 172.30.95.254:8080
* About to connect() to 172.30.95.254 port 8080 (#0)
* Trying 172.30.95.254...
* Connected to 172.30.95.254 (172.30.95.254) port 8080 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 172.30.95.254:8080
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: text/plain
<
Hello
* Closing connection 0
Expected Result
Working diagnostics behind proxy
@openshift/sig-master
The whole command tree will be removed in 3.12 via #20814
cc @sosiouxme
See https://github.com/openshift/origin/issues/20816#issuecomment-419470767