How can I install a kURL embedded cluster in an environment with an HTTP proxy?

I was under the impression that setting HTTP_PROXY and friends would be sufficient to stand up a kURL cluster in an environment requiring a proxy for egress.

I’ve tried the following

export HTTP_PROXY=kots-field-labs-squid-proxy:3128
export HTTPS_PROXY=kots-field-labs-squid-proxy:3128
curl -sSL https://k8s.kurl.sh/dx411-dex-lab1-e6-proxy | sudo bash

I have verified that the curl without the | bash returns the install script

with | bash -x, it stalls at this line:

++ curl -IfsSL https://kurl-sh.s3.amazonaws.com/dist/kurl-bin-utils-v2021.04.13-0.tar.gz
++ grep -i etag:
++ sed -r 's/.*"(.*)".*/\1/'
^C

I think this will work better if proxy info is in curl config file

$ cat ~/.curlrc
proxy = 10.128.0.3:3128
noproxy = localhost,127.0.0.1,10.96.0.0,10.0.0.0/8,10.138.0.91

Dmitriy’s curlrc answer works, or now I’ve found we probably need sudo -E:

The sudo has a handy argument -E or --preserve-env which will pass all your environment variables into the sudo environment.