K3s: give a config for k8s image url

Created on 28 Feb 2019  ·  15Comments  ·  Source: k3s-io/k3s

Is your feature request related to a problem? Please describe.

Location China, Can not run k3s server Success,in debug mode ,I find the reason is I can not pull docker image from https://k8s.gcr.io,detail like this:

E0228 11:28:13.907253 28057 kuberuntime_sandbox.go:58] CreatePodSandbox for pod "helm-install-traefik-8jflk_kube-system(cc24543e-3afd-11e9-a630-94de80af904c)" failed: rpc error: code = Unknown desc = failed to get sandbox image "k8s.gcr.io/pause:3.1": failed to pull image "k8s.gcr.io/pause:3.1": failed to resolve image "k8s.gcr.io/pause:3.1": no available registry endpoint: failed to do request: Head https://k8s.gcr.io/v2/pause/manifests/3.1: dial tcp: lookup k8s.gcr.io on 192.168.17.200:53: read udp 192.168.17.121:55619->192.168.17.200:53: i/o timeout

Describe the solution you'd like
It's not k3s's issue, But If k3s has a config to custom the k8s image url,I can change it to another docker registry to solve it。In these Google Forbidenned Country, open a k8s image url config will be very Useful.

kinenhancement

Most helpful comment

Unfortunately hard coded at the moment. We will fix. I know this is a major issue.

All 15 comments

I have the same request too,thanks.

me, too.

nowhere to find an option to change the images' repo.

Unfortunately hard coded at the moment. We will fix. I know this is a major issue.

@ibuildthecloud, somewhat of a hack, but can someone download the images and load them into containerd (via ./k3s crictl) before running sudo k3s server? If so, do you have a list of images that would be needed?

@ibuildthecloud, somewhat of a hack, but can someone download the images and load them into containerd (via ./k3s crictl) before running sudo k3s server? If so, do you have a list of images that would be needed?

From what I can tell (and tried), k3s (containerd) needs to be running for the crictl commands to work. Also, if you modify the containerd config /var/lib/rancher/k3s/agent/etc/containerd/config.toml it will get overwritten when you start/restart k3s. I tried to add an unsecure registry to the containerd config but the changes were overwritten.

@Prodian0013 agent config change must update source code ...
and crictl pull images but it not any arguments to tag it gcr.io/xx:xx

before the problem solved, this trick may help you make the k3s server work well.

131#comment-469652285

When this gonna be fixed.

This may be fixed with the most recent airgap PR.

Related issues:
/issues/172
/issues/166

Unfortunately hard coded at the moment. We will fix. I know this is a major issue.

Can I solve this problem in "v0.5.0-rc2"? Thanks!

Yep, this is configurable with #345 and will be available in the v0.5.0 release

My k3s version is v0.5.0 (8c0116dd)
How to config?

@lianghuiyuan

vi /etc/systemd/system/k3s.service
ExecStart=/usr/local/bin/k3s server --pause-image=docker.io/xiongsongsong/pause:3.1

@xiongsongsong
Thank you so much!
My k3s is runing in K3OS, there is no "/etc/systemd/system/k3s.service".
I am puzzled, because of the GFW I pulled an image with k3s crictl pull anjia0532/pause:3.1
now the image named "docker/io/anjia0532/pause:3.1",
image

I run a pod, it still failed to get sandbox image "k8s.gcr.io/pause:3.1"
image

I want to rename the image "docker/io/anjia0532/pause:3.1" to "k8s.gcr.io/pause:3.1"
but find no rename command in K3OS with containerd.

@lianghuiyuan Have you forgotten systemctl restart k3s?

Was this page helpful?
0 / 5 - 0 ratings