K3s: kubelet-arg flag bug

Created on 17 Apr 2019  路  7Comments  路  Source: k3s-io/k3s

k3s server --kubelet-arg flag
Set this config:
k3s server --kubelet-arg="pod-infra-container-image=registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0"

run as :
Running kubelet --cluster-domain=cluster.local --kubeconfig=/var/lib/rancher/k3s/agent/kubeconfig.yaml --cni-bin-dir=/var/lib/rancher/k3s/data/e249e3fc5ccf8ea07732c672f3062154b47357f5c85e1735339f087752a0f3ee/bin --cgroup-driver=cgroupfs --container-runtime=remote --kubelet-cgroups=/systemd/user.slice/user-0.slice --healthz-bind-address=127.0.0.1 --serialize-image-pulls=false --runtime-cgroups=/systemd/user.slice/user-0.slice --pod-infra-container-image=registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0 ...

when I describe the pod:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 96s default-scheduler Successfully assigned kube-system/coredns-857cdbd8b4-9hmf5 to swarm-manager
Warning FailedCreatePodSandBox 36s kubelet, swarm-manager Failed create pod sandbox: 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 74.125.203.82:443: i/o timeout

kinenhancement

Most helpful comment

Appears to work as designed with v0.5.0-rc4. Ran:

./k3s-v0.5.0-rc4 server --pause-image=registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0

The image I specified was downloaded:

# ./k3s-v0.5.0-rc4 crictl images
IMAGE                                                             TAG                 IMAGE ID            SIZE
docker.io/coredns/coredns                                         1.3.0               2ee68ed074c6e       12.3MB
docker.io/library/traefik                                         1.7.9               98768a8bf3fed       19.9MB
docker.io/rancher/klipper-helm                                    v0.1.5              c1e4f72eb6760       27.1MB
docker.io/rancher/klipper-lb                                      v0.1.1              4a065d8dfa588       2.71MB
registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64   3.0                 99e59f495ffaa       314kB

And appears in critcl info:

# ./k3s-v0.5.0-rc4 crictl info | grep pause
    "sandboxImage": "registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0",

All 7 comments

rancher/k3s/pull/345 may help after that feature is merged

Whether the problem has been solved

if kubeletFlags.ContainerRuntime == "remote" && cleanFlagSet.Changed("pod-infra-container-image") {
                klog.Warning("Warning: For remote container runtime, --pod-infra-container-image is ignored in kubelet, which should be set in that remote runtime instead")
            }

As the described in kubelet, the flag pod-infra-container-image will be ignored when remote container runtime is being used.

0.5.0-rc4 is available to test this change, a pause-image flag has been added for k3s to configure this setting for containerd.

@leo1971 @RobinsChens @szlyunnan Can you try it out with v0.5.0-rc4?

Appears to work as designed with v0.5.0-rc4. Ran:

./k3s-v0.5.0-rc4 server --pause-image=registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0

The image I specified was downloaded:

# ./k3s-v0.5.0-rc4 crictl images
IMAGE                                                             TAG                 IMAGE ID            SIZE
docker.io/coredns/coredns                                         1.3.0               2ee68ed074c6e       12.3MB
docker.io/library/traefik                                         1.7.9               98768a8bf3fed       19.9MB
docker.io/rancher/klipper-helm                                    v0.1.5              c1e4f72eb6760       27.1MB
docker.io/rancher/klipper-lb                                      v0.1.1              4a065d8dfa588       2.71MB
registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64   3.0                 99e59f495ffaa       314kB

And appears in critcl info:

# ./k3s-v0.5.0-rc4 crictl info | grep pause
    "sandboxImage": "registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0",

Thanks for testing @dnoland1!

Was this page helpful?
0 / 5 - 0 ratings