https://rancher.com/ logo
#k3s
Title
m

melodic-hamburger-23329

08/09/2022, 7:37 AM
nerdctl system prune --all
doesn’t seem to work with k3s. `$ nerdctl version`:
Copy code
WARN[0000] unable to determine buildctl version: exec: "buildctl": executable file not found in $PATH
WARN[0000] unable to determine runc version: exec: "runc": executable file not found in $PATH
Client:
 Version:	v0.22.2
 OS/Arch:	linux/amd64
 Git commit:	2899222cb0715f1e5ffe356d10c3439ee8ee3ba4
 builctl:
  Version:

Server:
 containerd:
  Version:	v1.6.6-k3s1
  GitCommit:
 runc:
  Version:
`nerdctl system prune --all`:
Copy code
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all images without at least one container associated to them

Are you sure you want to continue? [y/N] y
FATA[0000] needs CNI plugin "firewall" to be installed in CNI_PATH ("/var/lib/rancher/k3s/data/current/bin"), see <https://github.com/containernetworking/plugins/releases>: exec: "/var/lib/rancher/k3s/data/current/bin/firewall": stat /var/lib/rancher/k3s/data/current/bin/firewall: no such file or directory
`cat /etc/nerdctl/nerdctl.toml`:
Copy code
address        = "unix:///run/k3s/containerd/containerd.sock"
namespace      = "<http://k8s.io|k8s.io>"
snapshotter    = "stargz"
cgroup_manager = "systemd"
cni_path       = "/var/lib/rancher/k3s/data/current/bin"
cni_netconfpath = "/var/lib/rancher/k3s/agent/etc/cni/net.d"
With plain v1.6.6 containerd (RD 1.5.0 in containerd mode with k8s disabled) the commands executed without issues.
c

creamy-pencil-82913

08/10/2022, 3:40 AM
This seems like a nerdctl to issue. We don't include any of those binaries or the firewall plugin. Why does it need that plugin just to run a prune?
m

melodic-hamburger-23329

08/10/2022, 3:42 AM
Should I create issue to https://github.com/containerd/nerdctl ?
c

creamy-pencil-82913

08/10/2022, 3:50 AM
Probably a good start yeah
m

melodic-hamburger-23329

08/10/2022, 5:42 AM
@creamy-pencil-82913 btw, where are buildctl and runc?
runc is necessary, right? Is it bundled as part of some k3s binary? I guess buildctl is not necessary, but can/should it be included in k3s installation?
c

creamy-pencil-82913

08/15/2022, 8:09 PM
I don’t know what buildctl is; it’s not something we provide. runc is packaged within k3s
m

melodic-hamburger-23329

08/17/2022, 4:30 AM
@creamy-pencil-82913 buildctl is part of buildkitd, which I believe is part of k3s. https://github.com/moby/buildkit#quick-start
c

creamy-pencil-82913

08/17/2022, 4:35 AM
It is not. We don't include buildkit, nerdctl, or any of that.
m

melodic-hamburger-23329

08/17/2022, 4:40 AM
hm, I see. I guess I have misunderstood the architecture, or maybe confused with RD. So RD includes k3s AND buildkitd, but plain k3s doesn’t include buildkitd; is this correct?
c

creamy-pencil-82913

08/17/2022, 5:02 AM
correct. K3s is just kubernetes + containerd
2
All the extra developer tooling that comes with Rancher Desktop does not come from K3s.
m

melodic-hamburger-23329

08/17/2022, 5:02 AM
Undestood! Thanks for clarification.
k

kind-summer-7554

09/03/2023, 8:28 PM
nerdctl compose -f compose.yml down && nerdctl rmi -f containerName
nerdctl compose -f compose.yml down && nerdctl rmi -f containerName
179 Views