k3s-io / k3s

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

[Release-1.27] - Support containerd config_path for stargz snapshotter #10156

Closed brandond closed 3 months ago

brandond commented 4 months ago

Backport fix for Support containerd config_path for stargz snapshotter

mdrahman-suse commented 3 months ago

Validated on release-1.28 branch with commit 9d5becb2

Testing

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

Validation:

$ k3s -v
k3s version v1.27.14+k3s-6d6cf866 (6d6cf866)
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"
...