Open Cubxity opened 2 years ago
This solution helped me here:
Hello!
I'm facing the same issue on Oracle Linux 8 with CGroupsV2 and rootless podman.
I'm already using CGroupsV2 so no additional changes have been required.
But still the cluster was unable to spin-up. The command above—especially the --k3s-arg '--kubelet-arg=feature-gates=KubeletInUserNamespace=true@server:*'
parameter did the trick.
But unfortunately it is not sufficient. The cluster starts up but is unable to launch any pod. The log file is full of entries like this:
time="2023-05-24T06:20:19.651896955+02:00" level=error msg="RunPodSandbox for &PodSandboxMetadata{Name:coredns-59b4f5bbd5-l5bc8,Uid:2a286e4b-49bd-408d-9a7a-b78d8a172793,Namespace:kube-system,Attempt:0,} failed, error" error="failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting \"/var/lib/rancher/k3s/agent/containerd/io.containerd.grpc.v1.cri/sandboxes/741f6346648e0eebfcd8abb7d088909dfe6090425a9ca72f74c83451f3369032/resolv.conf\" to rootfs at \"/etc/resolv.conf\": mount /var/lib/rancher/k3s/agent/containerd/io.containerd.grpc.v1.cri/sandboxes/741f6346648e0eebfcd8abb7d088909dfe6090425a9ca72f74c83451f3369032/resolv.conf:/etc/resolv.conf (via /proc/self/fd/6), flags: 0x5021: operation not permitted: unknown"
I have been facing the same issue with KinD (https://github.com/kubernetes-sigs/kind/issues/3234) and @aojea with @AkihiroSuda traced it back [1], [2] to runc
: https://github.com/opencontainers/runc/pull/3805.
Hope this helps.
The upstream runc PR
has just been merged. When that's available in a release, it could potentially help here.
Now that
is merged, it may also work out of the box without KubeletInUserNamespace
? Or would that still be needed, and should be applied automatically (similar to the suggestion in https://github.com/k3d-io/k3d/issues/1082#issuecomment-1560509865)?
The upstream runc PR has been labeled 1.2.0 just now, so we can hopefully expect a release in the following weeks (months?).
From that point on what's a reasonable time expectation to get a resolution in k3s?
Thanks
it may also work out of the box without KubeletInUserNamespace
Still needed for non-filesystem stuffs such as sysctl https://github.com/kubernetes/kubernetes/blob/aa8cb97f65fe1d24e96eda129337d86109615570/pkg/kubelet/cm/container_manager_linux.go#L435
runc 1.2.0
Likely to take at least a month
I can verify, that the KubeletInUserNamespace
flag is still needed for rootless podman, but otherwise works :)
It could be enough to add to the guides, until any other resolution.
podman version 4.3.1 k3d version v5.6.0 k3s version v1.27.4-k3s1 (default)
What did you do
k3d cluster create
What did you expect to happen
The cluster should be created successfully.
Screenshots or terminal output
The k3s container kept bootlooping.
Which OS & Architecture
Which version of
k3d
Which version of docker