I cannot connect to internet from pods. My kubernetes cluster is behind proxy.
I have already set /env/environment
and /etc/systemd/system/docker.service.d/http_proxy.conf
, and confirmed that environment variables(http_proxy
, https_proxy
, HTTP_PROXY
, HTTPS_PROXY
, no_proxy
, NO_PROXY
) are correct.
But in the pod, when I tried echo $http_proxy
, answer is empty. I also tried curl -I https://rubygems.org
but it returned curl: (6) Could not resolve host: rubygems.org
.
So I think pod doesn't receive environment values correctly or there is something I forget to do what I should do. How should I do to solve it?
I tried to export http_proxy=http://xx.xx.xxx.xxx:xxxx; export https_proxy=...
.
After that, I tried again curl -I https://rubygems.org
and I can received header with 200.