From 48c2b5e0ef6a0fcf9dcae61465da6b53286513cf Mon Sep 17 00:00:00 2001 From: Amal Thundiyil Date: Sun, 29 Sep 2024 12:58:04 +0200 Subject: [PATCH 1/2] fix formatting errors Signed-off-by: Amal Thundiyil --- cpt-containers.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpt-containers.rst b/cpt-containers.rst index b59aaff..422a71d 100644 --- a/cpt-containers.rst +++ b/cpt-containers.rst @@ -238,7 +238,8 @@ By default, the repository used to search for the layers is ``unpacked.cern.ch`` The default values can be overwritten in the ``config.toml`` file using the ``--config`` option. A template ``config.toml`` file looks like this: -:: +.. code-block:: toml + # /etc/containerd/config.toml # important: explicitly use version 2 config format - @@ -259,7 +260,8 @@ A template ``config.toml`` file looks like this: address = "/run/containerd-cvmfs-grpc/containerd-cvmfs-grpc.sock" -:: +.. code-block:: toml + # /etc/containerd-cvmfs-grpc/config.toml From 42de7b55bccca050d4ea8abac0d3cb5d9684a7f7 Mon Sep 17 00:00:00 2001 From: Amal Thundiyil Date: Sun, 29 Sep 2024 12:58:08 +0200 Subject: [PATCH 2/2] add example for using cvmfs-snapshotter with k3s Signed-off-by: Amal Thundiyil --- cpt-containers.rst | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/cpt-containers.rst b/cpt-containers.rst index 422a71d..65aebf3 100644 --- a/cpt-containers.rst +++ b/cpt-containers.rst @@ -294,6 +294,45 @@ Pulling this 9GB (4.3GB compressed) image usually takes about two minutes, with See also the `cvmfs documentation page in nerdctl. `_. +Running with k3s +^^^^^^^^^^^^^^^^ +To configure k3s, edit ``/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl`` with the following content: + +.. code-block:: toml + + version = 2 + [plugins."io.containerd.grpc.v1.cri".containerd] + snapshotter = "cvmfs-snapshotter" + disable_snapshot_annotations = false + [proxy_plugins] + [proxy_plugins.cvmfs-snapshotter] + type = "snapshot" + address = "/run/containerd-cvmfs-grpc/containerd-cvmfs-grpc.sock" + [plugins."io.containerd.grpc.v1.cri".cni] + bin_dir = "/var/lib/rancher/k3s/data/current/bin" + conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d" + +After configuration, restart k3s with ``systemctl restart k3s``. + +To test, apply this sample pod configuration: + +.. code-block:: yaml + + apiVersion: v1 + kind: Pod + metadata: + name: python-http-server + spec: + containers: + - name: python-server + image: python:3.9 + imagePullPolicy: Always + command: ["python", "-m", "http.server", "8000"] + ports: + - containerPort: 8000 + +Verify the setup using ``kubectl describe`` to check pod details. Note the startup time is about 2-3 seconds, compared to 13 seconds with the default snapshotter. For further verification, check the cvmfs-snapshotter logs using ``journalctl -u cvmfs-snapshotter``. + ``podman`` integration (pre-production) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~