{"id":949,"date":"2021-01-07T19:56:05","date_gmt":"2021-01-07T18:56:05","guid":{"rendered":"https:\/\/blog.unetresgrossebite.com\/?p=949"},"modified":"2021-01-08T14:50:21","modified_gmt":"2021-01-08T13:50:21","slug":"kubernetes-ceph-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/blog.unetresgrossebite.com\/?p=949","title":{"rendered":"Kubernetes &#038; Ceph on Raspberry Pi"},"content":{"rendered":"<p>Having recently deployed yet-another Kubernetes cluster using Kubespray, experimenting with a Raspberry Pi lab, I&#8217;ve been looking with some issue I was last having, with Raspbian.<\/p>\n<p>The issue being that Raspbian does not ship with the rbd kernel module, which is usually necessary attaching rbd devices out of a Ceph cluster.<br \/>\nOne way to get around this would obviously be to rebuild the kernel, though I&#8217;m usually reluctant to do so.<\/p>\n<p>Digging further, it appears that as an alternative to the rbd kernel module, we may use the nbd one, which does ship with Raspbian.<\/p>\n<p>&nbsp;<\/p>\n<p>Here is how we may proceed:<\/p>\n<p>&nbsp;<\/p>\n<p><code># apt-get install ceph-common rbd-nbd<br \/>\n# scp -p root@mon1:\/etc\/ceph\/ceph.conf \/etc\/ceph<br \/>\n# scp -p root@mon1:\/etc\/ceph\/ceph.client.admin.keyring \/etc\/ceph<br \/>\n# rbd -p kube ls<br \/>\n# rbd-nbd map kube\/kubernetes-dynamic-pvc-d213345c-c5e8-11ea-ab48-ae4bf5a40627<br \/>\n# mount \/dev\/nbd0 \/mnt<br \/>\n[...]<br \/>\n# mount \/mnt<br \/>\n# rbd-nbd unmap \/dev\/nbd0<br \/>\n<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Now, that&#8217;s a first step. The next one would to to get this working with Kubernetes.<br \/>\nLately, the <i>CSI<\/i> (Container Storage Interface) is being promoted up to a point that the Kubernetes scheduler image no longer ships with Ceph binaries: a controller will be dealing devices provisioning, while another one would be attaching and releasing Ceph block devices on behalf of our nodes.<\/p>\n<p>Fortunately, while it is not official yet, all of the container images required can be found, searching on GitHub and DockerHub.<br \/>\nI did publish a copy of the <a href=\"https:\/\/github.com\/faust64\/kube-magic\/tree\/master\/examples\/ceph-csi-arm\" target=\"_blank\" rel=\"noopener\">configuration files required setting up Ceph rbd provisioning and devices mapping on Kubernetes<\/a>. Although it is mandatory for your nodes to run <a href=\"http:\/\/downloads.raspberrypi.org\/raspios_lite_arm64\/\" target=\"_blank\" rel=\"noopener\">some arm64 versions of the Raspbian image, which is currently in beta<\/a>, though has been working pretty well as far as I could see.<\/p>\n<p>&nbsp;<\/p>\n<p>This is yet another victory for Kubernetes, against products such as OpenShift: Lightweight, modular, portable, easy to deploy, &#8230; Efficient.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Having recently deployed yet-another Kubernetes cluster using Kubespray, experimenting with a Raspberry Pi lab, I&#8217;ve been looking with some issue I was last having, with Raspbian. The issue being that Raspbian does not ship with the rbd kernel module, which is usually necessary attaching rbd devices out of a Ceph cluster. One way to get [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":952,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,5,14,2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/949"}],"collection":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=949"}],"version-history":[{"count":5,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/949\/revisions"}],"predecessor-version":[{"id":960,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/949\/revisions\/960"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/media\/952"}],"wp:attachment":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}