17

I am new to cluster container management, and this question is the basis for all the freshers over here.

I read some documentation, but still, my understanding is not too clear, so any leads.. helping to understand?

  1. Somewhere it is mentioned, Minikube is used to run Kubernetes locally. So if we want to maintain cluster management in my four-node Raspberry Pi, then Minikube is not the option?
  2. Does Minikube support only a one-node system?
  3. Docker Compose is set of instructions and a YAML file to configure and start multiple Docker containers. Can we use this to start containers of the different hosts? Then for simple orchestration where I need to call container of the second host, I don't need any cluster management, right?
  4. What is the link between Docker Swarm and Kubernetes? Both are independent cluster management. Is it efficient to use Kubernetes on Raspberry Pi? Any issue, because I was told that Kubernetes in single node takes the complete memory and CPU usage? Is it true?
  5. Is there other cluster management for Raspberry Pi?

I think this 4-5 set will help me better.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
stackjohnny
  • 645
  • 3
  • 7
  • 22

6 Answers6

24

Presuming that your goal here is to run a set of containers over a number of different Raspberry Pi based nodes:

  • Minikube isn't really appropriate. This starts a single virtual machine on a Windows, MacOS or Linux and installs a Kubernetes cluster into it. It's generally used by developers to quickly start-up a cluster on their laptops or desktops for development and testing purposes.

  • Docker Compose is a system for managing sets of related containers. So for example if you had a web server and database that you wanted to manage together you could put them in a single Docker Compose file.

  • Docker Swarm is a system for managing sets of containers across multiple hosts. It's essentially an alternative to Kubernetes. It has fewer features than Kubernetes, but it is much simpler to set up.

If you want a really simple multi-node Container cluster, I'd say that Docker swarm is a reasonable choice. If you explicitly want to experiment with Kubernetes, I'd say that kubeadm is a good option here. Kubernetes in general has higher resource requirements than Docker Swarm, so it could be somewhat less suited to it, although I know people have successfully run Kubernetes clusters on Raspberry Pis.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rory McCune
  • 1,371
  • 10
  • 17
  • 1
    what if I want to use only 1 node raspi pi? what is the performance trend? – stackjohnny Aug 28 '18 at 05:50
  • If you're just planning to use one node, apart from for learning purposes, there's not a lot of point in using either swarm or K8s (you don't need their orchestration capabilities). I've not tried it, but I'd guess k8s will struggle on a single Pi, Swarm I'd reckon would be fine. – Rory McCune Aug 28 '18 at 09:38
  • oh also if you just want to practice k8s you can run free instances with https://labs.play-with-k8s.com/ and swarm at https://labs.play-with-docker.com/ – Rory McCune Aug 28 '18 at 09:38
  • 1
    Just FYI, lots of good reasons to run a single-instance Swarm over just "standard docker or docker-compose": https://github.com/BretFisher/ama/issues/8 – Bret Fisher Aug 29 '18 at 04:44
13

Docker Compose A utility to to start multiple docker containers on a single host using a single docker-compose up. This makes it easier to start multiple containers at once, rather than having do mutliple docker run commands.

Docker swarm A native container orchestrator for Docker. Docker swarm allows you to create a cluster of docker containers running on multiple machines. It provides features such as replication, scaling, self-healing i.e. starting a new container when one dies ...

Kubernetes Also a container orchestrator. Kubernetes and Docker swarm can be considered as alternatives to one another. They both try to handle managing containers starting in a cluster

Minikube Creating a real kubernetes cluster requires having multiple machines either on premise or on a cloud platform. This is not always convenient if someone is just new to Kubernetes and trying to learn by playing around with Kubernetes. To solve that minikube allows you to start a very basic Kubernetes cluster that consists of a single VM on you machine, which you can use to play around with Kubernetes.

Minikube is not for a production or multi-node cluster. There are many tools that can be used to create a multi-node Kubernetes cluster such as kubeadm

yamenk
  • 46,736
  • 10
  • 93
  • 87
  • In addition, there are many tutorials, blog posts about how to create a kubernetes cluster on raspberry-pi. Example: https://kubecloud.io/setup-a-kubernetes-1-9-0-raspberry-pi-cluster-on-raspbian-using-kubeadm-f8b3b85bc2d1 – yamenk Aug 26 '18 at 16:07
  • for single node in raspi , which is better? any comparision for single node in raspi? doscker swarm or k8? – stackjohnny Aug 28 '18 at 05:52
4

Containers are the future of application deployment. Containers are smallest unit of deployment in docker. There are three components in docker as docker engine to run a single container, docker-compose to run a multi-container application on a single host and docker-swarm to run multi-container application across hosts which also an orchestration tool.

In kubernetes, the smallest unit of deployment is Pod(which is composed of multiple container). Minikube is a single node cluster where you can install it locally and try, test and feel the kubernetes features locally. But, you can't scale this to more than a single machine. Kubernetes is an orchestration tool like Docker Swarm but more prominent than Docker Swarm with respect to features, scaling, resiliency, and security.

You can do the analysis and think about which tool will be fit for your requirements. Each one having their own pros or cons like docker swarm is good and easy to manage small clusters whereas kubernetes is much better for larger once. There is another orchestration tool Mesos which is also popular and used in largest size clusters.
Check this out, Choose your own Adventure but, it's just a general analogy and only to understand because all the three technologies are evolving rapidly.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
mohan08p
  • 5,002
  • 1
  • 28
  • 36
3

I get the impression you're mostly looking for confirmation and am happy to help with that if I can.

  1. Yes, minikube is local-only
  2. Yes, minikube is intended to be single-node
  3. Docker-compose isn't really an orchestration system like swarm and Kubernetes are. It helps with running related containers on a single host, but it is not used for multi-host.
  4. Kubernetes and Docker Swarm are both container orchestration systems. These systems are good at managing scaling up, but they have an overhead associated with them so they're better suited to multi-node.
  5. I don't know the range of orchestration options for Raspberry Pi, but there are Kubernetes examples out there such as Build Your Own Cloud with Kubernetes and Some Raspberry Pi.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ryan Dawson
  • 11,832
  • 5
  • 38
  • 61
1

For Pi, you can use Docker Swarm Mode on one or more Pi's. You can even run ARM emulation for testing on Docker for Windows/Mac before trying to get it all working directly on a Pi. Same goes for Kubernetes, as it's built-in to Docker for Windows/Mac now (no minikube needed).

Alex Ellis has a good blog on Pi and Docker and this post may help too.

Bret Fisher
  • 8,164
  • 2
  • 31
  • 36
0
  1. Is minikube the option?

The main options I see for cluster management on Raspberry Pi are; Docker Swarm k3s and microk8s. I found Docker Swarm easiest to set up and work with (using RPi 3Bs), and adequate for my purposes. The Kubernetes options were also fairly straightforward to set up though.

Set up guides:

Docker Swarm

k3s

microk8s

  1. Does Minikube support only a one-node system?

Don't know

  1. Can we use Docker Compose YAML files to start containers of the different hosts?

Yes, Docker Swarm stack/stack-deploy is a way to run services across multiple hosts:

When running Docker Engine in swarm mode, you can use docker stack deploy to deploy a complete application stack to the swarm. The deploy command accepts a stack description in the form of a Compose file.

  1. What is the link between Docker Swarm and Kubernetes?

From the Docker docs:

Kubernetes Services and Swarm Services are very different! Despite the similar name, the two orchestrators mean very different things by the term ‘service’. In Swarm, a service provides both scheduling and networking facilities, creating containers and providing tools for routing traffic to them. In Kubernetes, scheduling and networking are handled separately: deployments (or other controllers) handle the scheduling of containers as pods, while services are responsible only for adding networking features to those pods.

  1. Is there other cluster management for Raspberry Pi?

See q1. Also another "vanilla" way of doing it would be to create a script that scp copies dockerfiles then ssh connects to the hosts in turn and then runs them in turn.


Watch-it for RPi:

I found I needed to install extra modules (on Ubuntu, 3B) to get swarm mode to work seamlessly:

sudo apt install linux-modules-extra-raspi

Lee
  • 29,398
  • 28
  • 117
  • 170