-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fixes #4008 by retrieving environment variables prefixed with "CONTAINERD_" #4009
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I confirmed this works using the below. Note this didn't pull because I didn't have my proxy setup, but it is showing the expected values and using the environment variables correctly:
curl -fL https://raw.githubusercontent.com/nicolasbrechet/k3s/patch-1/install.sh | INSTALL_K3S_EXEC="--write-kubeconfig-mode 644" CONTAINERD_HTTP_PROXY="http://this.is.my.fake.proxy/" CONTAINERD_HTTPS_PROXY="https://this.is.my.fake.proxy/" INSTALL_K3S_COMMIT=699ea165231cf6d665425c50ff5c75e1831f4afb sh -
...
$ sudo cat /etc/systemd/system/k3s.service.env
CONTAINERD_HTTP_PROXY=http://this.is.my.fake.proxy/
CONTAINERD_HTTPS_PROXY=https://this.is.my.fake.proxy/
$ k describe -n kube-system pod/coredns-85cb69466-mpk6s
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 42s default-scheduler Successfully assigned kube-system/coredns-85cb69466-mpk6s to ip-172-31-26-123
Warning FailedCreatePodSandBox 14s (x3 over 42s) kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image "rancher/mirrored-pause:3.1": failed to pull image "rancher/mirrored-pause:3.1": failed to pull and unpack image "docker.io/rancher/mirrored-pause:3.1": failed to resolve reference "docker.io/rancher/mirrored-pause:3.1": failed to do request: Head "https://registry-1.docker.io/v2/rancher/mirrored-pause/manifests/3.1": proxyconnect tcp: dial tcp: lookup this.is.my.fake.proxy: no such host
@nicolasbrechet thank you for this and welcome to contributing to k3s! I just have one ask, can you please follow the instructions here to make sure your commits are signed off so that the DCO check can pass? https://github.com/k3s-io/k3s/pull/4009/checks?check_run_id=3600207069 Thanks again, we really appreciate the PR! |
Codecov Report
@@ Coverage Diff @@
## master #4009 +/- ##
==========================================
- Coverage 11.61% 11.16% -0.45%
==========================================
Files 131 132 +1
Lines 8860 8928 +68
==========================================
- Hits 1029 997 -32
- Misses 7606 7715 +109
+ Partials 225 216 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This is ready to go once the DCO is taken care of. |
Signed-off-by: Nicolas Brechet <nicolas.brechet@swisscom.com>
e9ff1be
to
57ad2f6
Compare
Sorry about that! DCO is taken care of, now. |
Proposed Changes
This PR simply modifies the install script to retrieve the environment variables that are prefixed with "CONTAINERD_",thus allowing to configure containerd at installation
Types of Changes
Bugfix
Verification
Install K3s master node with this change and variables prefixed with "CONTAINERD_"
On the master node, check the content of the /etc/systemd/system/k3s.service.env
Linked Issues
#4008
User-Facing Change
Further Comments