New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting CONTAINERD_NO_PROXY does not work #5642
Comments
The problem is that environment variables aren't ordered, so CONTAINERD_ variables may be shadowed by other variables, if they are processed later in the loop. This is easy enough to fix. |
This was referenced Jun 14, 2022
Validated on master with 61b714bEnvironment DetailsInfrastructure
Node(s) CPU architecture, OS, and Version:
Cluster Configuration:
Config.yaml:
Replication Steps
Results:
Validation Steps
Results:
|
Validated in 1.24.2-rc1+k3s1 |
Development [DEPRECATED]
automation
moved this from Waiting for RC
to Done Issue / Merged PR
Jun 24, 2022
I sure do appreciate how fast this was resolved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environmental Info:
K3s Version:
# k3s -v k3s version v1.23.6+k3s1 (418c3fa8) go version go1.17.5
Node(s) CPU architecture, OS, and Version:
Cluster Configuration:
Tested with single node with embedded sqlite and 3 node HA with embedded etcd
Describe the bug:
Setting CONTAINERD_NO_PROXY does not work.
As mentioned in #2026, #3552 and #4009, a new feature has been added to configure HTTP proxy settings, for Containerd.
I can confirm that any variable prefixed with
CONTAINERD_
is passed through with the exception ofCONTAINERD_NO_PROXY
Steps To Reproduce:
curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true sh -
Expected behavior:
containerd should have the following environment variables set which should allow it to pull containers from the Docker hub without going via the HTTP_PROXY.
Actual behavior:
Containers can not be pulled.
Additional context / logs:
This is where vars prefixed with
CONTAINERD_
are passed through.What I think is happening is https://github.com/k3s-io/k3s/blob/master/pkg/server/server.go#L440-L455 is always setting
NO_PROXY
which is overriding theCONTAINERD_NO_PROXY
An inspection of the environment for the containerd process shows
NO_PROXY
is always set regardless ifCONTAINERD_NO_PROXY
is set or not.# cat /proc/29698/environ LANG=C.UTF-8PATH=/var/lib/rancher/k3s/data/8c2b0191f6e36ec6f3cb68e2302fcc4be850c6db31ec5f8a74e4b3be403101d8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/var/lib/rancher/k3s/data/8c2b0191f6e36ec6f3cb68e2302fcc4be850c6db31ec5f8a74e4b3be403101d8/bin/auxINVOCATION_ID=a3956a06a8284ebc968c16ac89e3cb65JOURNAL_STREAM=8:298854SYSTEMD_EXEC_PID=29687HTTP_PROXY=http://this.is.my.fake.proxy/HTTPS_PROXY=https://this.is.my.fake.proxy/NO_PROXY=.svc,.cluster.local,10.42.0.0/16,10.43.0.0/16RES_OPTIONS= K3S_DATA_DIR=/var/lib/rancher/k3s/data/8c2b0191f6e36ec6f3cb68e2302fcc4be850c6db31ec5f8a74e4b3be403101d8NODE_NAME=k3s-01.example.com
The text was updated successfully, but these errors were encountered: