THIS IS WORK IN PROGRESS
The application starts a docker-in-docker instance and runs a Kubernetes kubelet.
Based on abresas/multi-container For docker in docker, check jpetazzo/dind.
The Kubernetes project is a cluster management solution by Google. This repo contains a resin.io application that starts a docker-in-docker instance and then runs a Kubernetes node, capable of running arbitrary "pods", that is, groups of containers. Please refer to the Kubernetes documentation to better understand how Kubernetes works.
To run this application, you will need to run a Kubernetes Master node (that serves the Kubernetes API) on another machine, and create a MASTER_IP
Environment Variable for this device. After that you can use kubectl to communicate with the Master and assign pods to your devices.
This repo uses a slightly modified version of the Kubernetes hyperkube binary to accomodate for the fact that we are running on ARM devices and we are using rce
(Resin.io's version of Docker, soon to be replaced by a regular Docker binary).
We also use Flannel to try to achieve the Kubernetes networking model, but this is not fully functional at the time. You should still be able to run a fully functional cluster over a local network.
If you're interested in looking at how this app works, take a look at the Dockerfile and the start.sh script. This script basically initializes a docker (rce) daemon and then starts the Kubernetes node apps as follows:
/hyperkube kubelet --api_servers=http://${MASTER_IP}:8080 --v=1 \
--address=0.0.0.0 --enable_server --docker-endpoint=$DOCKER_HOST &
/hyperkube proxy --master=http://${MASTER_IP}:8080 --v=1 &