<p>I recently finished a project where I created an App consisting of several docker containers. The purpose of the app was to collect some data and safe it to an databank and also allow user interactions over an simple web gui. The app was hosted on four different Raspberry Pi's and it was possible to collect data from all physicial maschines through an api. Further you could do some simple machine learning tasks like calculating anomalies in the sensor data of the Pi's.</p>

<p>Now I'm trying to take the next step and using kubernetes for some load balancing and remote updates. My main goal is to remote update all raspberries from my master node. Which, in theory, would be a very handy feature. Also I want to share the ressources of the Pi's within the cluster for calculations. </p>

<p>I read a lot about Kubernets, Minikube, K3's, Kind and all the different approaches to set up an Kubernetes cluster, but feel like I am missing "a last puzzle piece". </p>

<p>So from what I understood I need an approach which allows me to set up an local (because all machines are laying on my desk/ no cloud needed) multi node cluster. My master node would be (idealy) my laptop, running Ubuntu in a virtual machine. My rasberry's would be my slave/worker nodes. If I would want to update my cluster I can use the kubernetes remote update functionality. </p>

<p>So my question out of this would be: Does it makes sense to use several rasberries as nodes in a kubernetes cluster and to manage them from one master node (laptop) and do you have any suggestions about the way to achieve this setup. </p>

<p>I usally dont like those question not containing any specific code or questions by myself, but feel like an simple hint could accelerate my project noteable. If it's the wrong place please feel free to delete this question.</p>

<p>Best regards </p>

nail
<p>You didn't mention which rpi models you are using, but I assume you are not using rpi zeros. </p>

<blockquote>
  <p>My main goal is to remote update all raspberries from my master node.</p>
</blockquote>

<p>Assuming that by that you mean updating your applications running in kubernetes that is installed on rpi then keep reading. Otherwise ignore all I wrote, and what you probably need is ansible or other simmilar provisioning/configuration-management/application-deployment tool.</p>

<p>Now answering to your question:</p>

<blockquote>
  <p>Does it makes sense to use several rasberries as nodes in a kubernetes cluster</p>
</blockquote>

<p>yes, this is why people created k3s, so such setup is possible using less resources.</p>

<blockquote>
  <p>and to manage them from one master node (laptop) </p>
</blockquote>

<p>assuming you will be using it for learning purpouses then why not. It is possible, but just be aware that when master node goes down (e.g. when you turn off your laptop), all cluster goes down (or at least api-server communication so you wont be able to change cluster's state). Also make sure you are using bridge networking interface for your VM so it is visible in your local network as a standalone instance.</p>

<blockquote>
  <p>and do you have any suggestions about the way to achieve this setup.</p>
</blockquote>

<p>installing k3s on all nodes would be the easiest in your case. There are plenty of resources on the internet explaining how to achieve it.</p>

<hr>

<p>One last thing I would like to explain is the thing with updates.</p>

<p>Speaking of kubernetes updates you need to know that kubernetes doesn't update itself automatically. You need to explicitly update it. New k8s version is beeing released every 3 months that sometimes "breaks" things and backward compatibility is not possible (so always read <a href="https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG" rel="nofollow noreferrer">changelog</a> before updating stuff because rollbacks may not be possible unless you backed up an etcd cluster earlier).</p>

<p>Speaking of updating applications - To run your app all you do is send yaml files describing your application to k8s and it handles the rest. So if you want to update your app just update the tag on container image to newer version and k8s will handle the updates. <a href="https://www.weave.works/blog/kubernetes-deployment-strategies" rel="nofollow noreferrer">Read here</a> more about update strategies in k8s.</p>
