k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
28.04k stars 2.35k forks source link

[Release-1.29] - Support containerd config_path for stargz snapshotter #10154

Closed brandond closed 5 months ago

brandond commented 5 months ago

Backport fix for Support containerd config_path for stargz snapshotter

mdrahman-suse commented 5 months ago

Validated on release-1.29 branch with commit 12864fb6

Testing

Followed the steps mentioned here: https://github.com/k3s-io/k3s/issues/9976#issuecomment-2150792687

Validation:

$ k3s -v
k3s version v1.29.5+k3s-12864fb6 (12864fb6)
go version go1.21.9
$ sudo cat /var/lib/rancher/k3s/agent/etc/containerd/config.toml
# File generated by k3s. DO NOT EDIT. Use config.toml.tmpl instead.
version = 2

[plugins."io.containerd.internal.v1.opt"]
  path = "/var/lib/rancher/k3s/agent/containerd"
[plugins."io.containerd.grpc.v1.cri"]
  stream_server_address = "127.0.0.1"
  stream_server_port = "10010"
  enable_selinux = false
  enable_unprivileged_ports = true
  enable_unprivileged_icmp = true
  sandbox_image = "rancher/mirrored-pause:3.6"

[plugins."io.containerd.grpc.v1.cri".containerd]
  snapshotter = "stargz"
  disable_snapshot_annotations = false

[plugins."io.containerd.snapshotter.v1.stargz"]
cri_keychain_image_service_path = "/run/containerd-stargz-grpc/containerd-stargz-grpc.sock"
[plugins."io.containerd.snapshotter.v1.stargz".cri_keychain]
enable_keychain = true

[plugins."io.containerd.snapshotter.v1.stargz".registry]
  config_path = "/var/lib/rancher/k3s/agent/etc/containerd/certs.d"
...