-
Notifications
You must be signed in to change notification settings - Fork 980
Description
kubectl version
- Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.12", GitCommit:"a8b52209ee172232b6db7a6e0ce2adc77458829f", GitTreeState:"clean", BuildDate:"2019-10-15T12:12:15Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"windows/amd64"}
- Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.12", GitCommit:"524c3a1238422529d62f8e49506df658fa9c8b8c", GitTreeState:"clean", BuildDate:"2019-11-14T05:26:24Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}
Issue
When running the following behind a corporate proxy:
kubectl exec -it grafana-8665c55f6b-k7jpb ls -n monitoring
I'm seeing:
error: error sending request: Post https://k8s-fqdn:443/api/v1/namespaces/monitoring/pods/grafana-8665c55f6b-k7jpb/exec?command=ls&container=grafana&container=grafana&stdin=true&stdout=true&tty=true: tls: first record does not look like a TLS handshake
The same issue also happens with port forwarding e.g.:
kubectl -n monitoring port-forward prometheus-server-657c6d8f59-s7mjz 9090
error: error upgrading connection: error sending request: Post https://k8s-fqdn:443/api/v1/namespaces/monitoring/pods/prometheus-server-657c6d8f59-s7mjz/portforward: tls: first record does not look like a TLS handshake
How to reproduce
If the password for the https_proxy environment variable contains a hash symbol (URL encoded this is %23), it doesn't work and we get a TLS handshake error. If the password for the https_proxy environment variable contains a dollar symbol (URL encoded this is %24) it works fine.
The following does not work and gives the TLS handshake error above:
http_proxy=http://username:password%23@proxyhost:proxy-port
https_proxy=http://username:password%23@proxyhost:proxy-port
The following does work:
http_proxy=http://username:password%24@proxyhost:proxy-port
https_proxy=http://username:password%24@proxyhost:proxy-port
and we see:
kubectl exec -it grafana-8665c55f6b-k7jpb ls -n monitoring
LICENSE README.md bin public tools
NOTICE.md VERSION conf scripts
OR
kubectl -n monitoring port-forward prometheus-server-657c6d8f59-s7mjz 9090
Forwarding from 127.0.0.1:9090 -> 9090
Forwarding from [::1]:9090 -> 9090
as expected.