Skip to content
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

Crictl misses configuration by default #11152

Closed
chargio opened this issue Oct 23, 2024 · 1 comment
Closed

Crictl misses configuration by default #11152

chargio opened this issue Oct 23, 2024 · 1 comment

Comments

@chargio
Copy link

chargio commented Oct 23, 2024

Hi,

I've just installed k3s on a new Raspberry pi 5 (and 4), in a cluster, using curl.
Trying to use crictl, I've discovered that the information by default does not apply to K3s.

I was expecting the runtime-endpoint to be at:
unix:///run/containerd/containerd.sock
but it is actually at:
unix:///run/k3s/containerd/containerd.sock

As the configuration is different than the documentation in crictl, I suggest one of the options:

  • The socket is moved to the standard place. unix:///run/containerd/containerd.sock
  • The socket is aliased in the standard place, making unix:///run/containerd/containerd.sock an alias for unix:///run/k3s/containerd/containerd.sock
  • A default /etc/crictl.yaml is installed
$ cat /etc/crictl.yaml
runtime-endpoint: "unix:///run/k3s/containerd/containerd.sock"
image-endpoint: unix:///run/k3s/containerd/containerd.sock
timeout: 2
debug: true
pull-image-on-create: false
disable-pull-on-run: false
@brandond
Copy link
Member

brandond commented Oct 23, 2024

If you're using the crictl that comes with K3s, it already defaults to using the correct path. Are you perhaps instead using crictl from your Linux distro? That would of course not be aware of our non-standard path, and you'd need to export an env var or provide a config file to point it at the correct path.

root@systemd-node-1:~# which crictl
/usr/local/bin/crictl

root@systemd-node-1:~# ls -la /usr/local/bin/crictl
lrwxrwxrwx 1 root root 3 Oct 23 19:02 /usr/local/bin/crictl -> k3s

root@systemd-node-1:~# k3s --version
k3s version v1.30.5+k3s1 (9b586704)
go version go1.22.6

root@systemd-node-1:~# crictl --version
crictl version v1.29.0-k3s1

root@systemd-node-1:~# crictl --help | grep k3s/containerd
   --runtime-endpoint value, -r value  Endpoint of CRI container runtime service (default: uses in order the first successful one of [unix:///run/k3s/containerd/containerd.sock unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]). Default is now deprecated and the endpoint should be set instead. [$CONTAINER_RUNTIME_ENDPOINT]

root@systemd-node-1:~# crictl ps
CONTAINER           IMAGE               CREATED             STATE               NAME                     ATTEMPT             POD ID              POD
47f0427694178       019c70fd40547       27 seconds ago      Running             traefik                  0                   13b5fc3d822cd       traefik-67f6c94c47-zkdjf
c927097736acc       11a5d8a9f31aa       28 seconds ago      Running             lb-tcp-443               0                   27cde7c7d49c9       svclb-traefik-54ae582a-7szfc
b2358ebe28493       11a5d8a9f31aa       29 seconds ago      Running             lb-tcp-80                0                   27cde7c7d49c9       svclb-traefik-54ae582a-7szfc
2f4199e105cfd       c69fa2e9cbf5f       33 seconds ago      Running             coredns                  0                   97f4b2972af35       coredns-7b98449c4-2z8cn
34b9f80cbc8ad       48d9cfaaf3904       33 seconds ago      Running             metrics-server           0                   12ac1ce71f82e       metrics-server-cdcc87586-lhzbz
2ae32a6953ec0       5d221316a3c61       33 seconds ago      Running             local-path-provisioner   0                   31cc25e22fe94       local-path-provisioner-6795b5f9d8-qpn9q

@github-project-automation github-project-automation bot moved this from New to Done Issue in K3s Development Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

2 participants