Code Monkey home page Code Monkey logo

raspbernetes's Introduction

Raspbernetes

Automated and repeatable method of deploying a headless Kubernetes stack onto a cluster of Raspberry Pis. Completely hands off experience from power on.

Detailed blog and guide posted onto my medium account:

Prerequisites

The following tools and pre-requisites must be available on the machine being used to build the SD cards:

  • Linux - Because of filesystem requirements
  • bash - 4.0+
  • make - 4.1+
  • kubectl - 1.16.1
  • 4 Raspberry Pis (3 Masters and 1 Worker)

Applications

This stack is an opinionated way to deploy a home cluster with a HA design using haproxy and keepalived for cluster management.

See below for a list of the versions and applications used:

Configuration

A short explanation of each environment variable that can be overridden.

Environment Settings

Mount device configuration:

  • MNT_DEVICE - Device name of SD slot on your local machine. (default: /dev/mmcblk0)

Raspberry Pi network and hostname configuration:

  • RPI_NETWORK_TYPE - Network option of choice. Either eth0 or wlan0. (default: wlan0)
  • RPI_HOSTNAME - Hostname for specific Raspberry Pi. (default: rpi-kube-master-01)
  • RPI_IP - Static IP to set. (default: 192.168.1.101)
  • RPI_DNS - DNS or Gateway. Generally your router ip. (default: 192.168.1.1)
  • RPI_TIMEZONE - Local timezone. (default: Australia/Melbourne)

Kubernetes specific configuration:

  • KUBE_NODE_TYPE - Type of Kubernetes node. Either master or worker. (default: master)
  • KUBE_MASTER_VIP - Floating virtual IP (VIP) to use in keepalived. (default: 192.168.1.100)
  • KUBE_MASTER_IP_01 - IP of 1st master node to use in haproxy. (default: 192.168.1.101)
  • KUBE_MASTER_IP_02 - IP of 2nd master node to use in haproxy. (default: 192.168.1.102)
  • KUBE_MASTER_IP_03 - IP of 3rd master node to use in haproxy. (default: 192.168.1.103)

Network configuration if using Wifi. Accompanied with RPI_NETWORK_TYPE of wlan0:

  • WIFI_SSID - Local SSID to connect Wifi to. (default: n/a)
  • WIFI_PASSWORD - Password of above SSID to connect to Wifi using wpa_supplicant. (default: n/a)

Run

Be mindful of an SSH key that gets generated with this build that is stored in the output/ssh/ directory. This is not committed to git and should be treated safe like a normal private key. If you lose this key you will no longer be able to manage your stack. This is crucial for inter-cluster communication and remoting for management.

Build

Once appropriate above environment variables have been exported to suit your specific local environment, the below command will build an SD card with all automation scripts:

make build

Help

The help target is set as the default target, so display the above brief descriptions. Use the below command as is to print to the terminal:

make

raspbernetes's People

Contributors

lucasteligioridis avatar

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.