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

containerd/cri: enable the btrfs snapshotter #4316

Merged
merged 3 commits into from
Oct 30, 2021

Conversation

dweomer
Copy link
Contributor

@dweomer dweomer commented Oct 23, 2021

Proposed Changes

Enable the BTRFS snapshotter in containerd.

Readily available on many Linux systems including SUSE offerings. Seems pretty decent. No good reason not to ship it.

Types of Changes

The BTRFS snapshotter is now builtin to the k3s binary and ready for action.

Verification

Tested with:

  • vagrant up --provider=libvirt
  • VAGRANT_EXPERIMENTAL=disks vagrant up --provider=virtualbox
cd tests/snapshotter/btrfs/opensuse-leap
vagrant plugin install vagrant-libvirt # if using the libvirt provider
vagrant plugin install vagrant-k3s
VAGRANT_EXPERIMENTAL=disks vagrant up # envvar required for any provider other than libvirt

Failure will get you a non-zero exit code. On success you should see output like this:

==> snapshotter-btrfs: Running provisioner: k3s-ready (shell)...
    snapshotter-btrfs: Running: inline script
    snapshotter-btrfs: Waiting for node to be ready ...
    snapshotter-btrfs: node/test condition met
    snapshotter-btrfs: 
    snapshotter-btrfs: real	0m16.596s
    snapshotter-btrfs: user	0m0.826s
    snapshotter-btrfs: sys	0m0.154s
    snapshotter-btrfs: Waiting for deployment "coredns" rollout to finish: 0 of 1 updated replicas are available...
    snapshotter-btrfs: deployment "coredns" successfully rolled out
    snapshotter-btrfs: 
    snapshotter-btrfs: real	1m18.105s
    snapshotter-btrfs: user	0m0.193s
    snapshotter-btrfs: sys	0m0.030s
==> snapshotter-btrfs: Running provisioner: k3s-status (shell)...
    snapshotter-btrfs: Running: inline script
    snapshotter-btrfs: + kubectl get node,all -A -o wide
    snapshotter-btrfs: NAME        STATUS   ROLES                  AGE   VERSION                INTERNAL-IP      EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION         CONTAINER-RUNTIME
    snapshotter-btrfs: node/test   Ready    control-plane,master   81s   v1.22.2+k3s-2f4dfb11   192.168.121.99   <none>        openSUSE Leap 15.3   5.3.18-59.27-default   containerd://1.5.7-k3s1
    snapshotter-btrfs: 
    snapshotter-btrfs: NAMESPACE     NAME                        READY   STATUS    RESTARTS   AGE   IP          NODE   NOMINATED NODE   READINESS GATES
    snapshotter-btrfs: kube-system   pod/coredns-d47d4cb-t7btl   1/1     Running   0          79s   10.42.0.2   test   <none>           <none>
    snapshotter-btrfs: 
    snapshotter-btrfs: NAMESPACE     NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE   SELECTOR
    snapshotter-btrfs: default       service/kubernetes   ClusterIP   10.43.0.1    <none>        443/TCP                  94s   <none>
    snapshotter-btrfs: kube-system   service/kube-dns     ClusterIP   10.43.0.10   <none>        53/UDP,53/TCP,9153/TCP   90s   k8s-app=kube-dns
    snapshotter-btrfs: 
    snapshotter-btrfs: NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES                                   SELECTOR
    snapshotter-btrfs: kube-system   deployment.apps/coredns   1/1     1            1           90s   coredns      rancher/mirrored-coredns-coredns:1.8.4   k8s-app=kube-dns
    snapshotter-btrfs: 
    snapshotter-btrfs: NAMESPACE     NAME                              DESIRED   CURRENT   READY   AGE   CONTAINERS   IMAGES                                   SELECTOR
    snapshotter-btrfs: kube-system   replicaset.apps/coredns-d47d4cb   1         1         1       80s   coredns      rancher/mirrored-coredns-coredns:1.8.4   k8s-app=kube-dns,pod-template-hash=d47d4cb
    snapshotter-btrfs: + btrfs subvolume list /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.btrfs
    snapshotter-btrfs: ID 256 gen 22 top level 5 path @k3s
    snapshotter-btrfs: ID 261 gen 17 top level 256 path agent/containerd/io.containerd.snapshotter.v1.btrfs/snapshots/1
    snapshotter-btrfs: ID 262 gen 18 top level 256 path agent/containerd/io.containerd.snapshotter.v1.btrfs/active/2
    snapshotter-btrfs: ID 264 gen 20 top level 256 path agent/containerd/io.containerd.snapshotter.v1.btrfs/snapshots/3
    snapshotter-btrfs: ID 266 gen 22 top level 256 path agent/containerd/io.containerd.snapshotter.v1.btrfs/snapshots/4
    snapshotter-btrfs: ID 267 gen 22 top level 256 path agent/containerd/io.containerd.snapshotter.v1.btrfs/active/5

Linked Issues

#4320

User-Facing Change

The BTRFS snapshotter is now builtin to the k3s binary and ready for action

Further Comments

@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2021

Codecov Report

Merging #4316 (3d53da1) into master (3da1bb3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4316   +/-   ##
=======================================
  Coverage   11.56%   11.56%           
=======================================
  Files         135      135           
  Lines        9331     9331           
=======================================
  Hits         1079     1079           
  Misses       8021     8021           
  Partials      231      231           
Flag Coverage Δ
inttests 0.75% <ø> (ø)
unittests 11.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3da1bb3...3d53da1. Read the comment docs.

Copy link
Contributor

@brandond brandond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what's the binary size impact of adding this?

@dweomer
Copy link
Contributor Author

dweomer commented Oct 23, 2021

Out of curiosity, what's the binary size impact of adding this?

Comparing with the 1.22.2 amd64 binary in my ~/Downloads directory:

 $ ls -alFh ../../../dist/artifacts/k3s ~/Downloads/k3s
-rwxr-xr-x 1 jacob jacob 51871744 Oct 22 11:32 ../../../dist/artifacts/k3s*
-rw-rw-r-- 1 jacob jacob 53235712 Oct 23 08:45 /home/jacob/Downloads/k3s

... so a little under +1.4 MB

@dweomer dweomer changed the title Buttery Goodness containerd/cri: enable the btrfs snapshotter Oct 23, 2021
@dweomer dweomer force-pushed the buttery-goodness branch 2 times, most recently from 4f61da5 to de87f8e Compare October 23, 2021 21:37
@dweomer dweomer linked an issue Oct 23, 2021 that may be closed by this pull request
1 task
@dweomer dweomer force-pushed the buttery-goodness branch 3 times, most recently from 96ab0cb to b470e93 Compare October 25, 2021 19:09
Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
@dweomer dweomer force-pushed the buttery-goodness branch 3 times, most recently from 3b47f4b to 26c1c79 Compare October 30, 2021 05:30
Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
@dweomer dweomer merged commit 702fe24 into k3s-io:master Oct 30, 2021
@dweomer dweomer deleted the buttery-goodness branch October 30, 2021 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable the btrfs snapshotter
4 participants