Giter Club home page Giter Club logo

k8sonpi's Introduction

Kubernetes on RaspberryPI

This sets up a one node Kubernetes cluster on a RaspberryPI. This is based on the Hypriot Docker image for RPi.

Why ? Because it is the easiest way to start experimenting with containers on ARM architectures which can be extremely useful for the IoT and Embedded business. It can also be a great platform to investigate scalability issues of both Docker and Kubernetes.

Requirements

You will need a RaspberryPi and you will need to have installed the Hypriot OS image on it

For the impatient:

  1. Clone this repository on your Pi

    $ git clone https://github.com/runseb/k8s4pi.git

    $ cd ./k8s4pi

  2. Run the build.sh script

    $ ./build.sh

  3. Enjoy

The longer version:

We use the Kubernetes kubelet running as a systemd unit to monitor a few Docker containers that make up the Kubernetes cluster. The Kubelet binary for ARM is downloaded and installed in /usr/bin/kubelet, a manifest is copied to /etc/kubernetes/manifests/kubernetes.yaml which represents a Kubernetes Pod that make up all the required containers.

In this pod we have:

  1. An etcd container. Which we run by building an etcd image from scratch on the PI.

  2. Several containers based on the Hyperkube image. Hyperkube is a single binary that can start all the Kubernetes components: API server, controller, scheduler. We build a local Hyperkube image.

  3. Then a little trick. Kubernetes does assume that you will run the nodes on x86_64 and automatically pulls an image called the pause container. This container is used to get an IP and share that IP with all the containers in the pod. For the PI, we need to run this pause container on ARM, we trick Kubernetes by building the image gcr.io/google_containers/pause:0.8.0 locally after having compiled the pause Golang code for ARM.

  4. Finally, we download the Kubernetes client kubectl for ARM from the official release:

    $ curl -fsSL -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.0.3/bin/linux/arm/kubectl

The ARM binaries for the kubelet and hyperkube are downloaded from https://github.com/andrewpsuedonym/Kubernetes-Arm-Binaries.git

k8sonpi's People

Contributors

sebgoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

k8sonpi's Issues

Just notifying about a similar project

Hello,

This isn't a "real" issue but it was the first way I thought of in order to contact you.

I've a similar project, but that doesn't depend on andrewpsuedonym.
It has the name kubernetes-on-arm

All source code how to build the latest versions is there and even how to make the sd card.

It would be great if you could check it out and eventually give some suggestions
After all, we're trying to do the same thing ๐Ÿ˜„

About etcd

You may know it but it may be easier to use andrewpsuedonym/etcd than to build your own etc container. It may avoid a long build phase ;-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.