Skip to content
lka edited this page Oct 8, 2019 · 3 revisions

Welcome to the flash-to-kubernetes-on-raspi wiki!

How to come from flash-card to kubernetes on a bunch of raspberry pi's?

Goal

I want to build an ansible project that is able to configure and update my raspberry pi's from bare metal to a running kubernetes cluster.

Preliminaries

  • I use a fritz!box as entrypoint to the internet and it's DHCP server provides IP-Adresses and delivers them with it's dns if I query with nslookup and the hostname. So I can use the hostname to get the connection to new hosts.
  • My raspberry pi's are of version 3 B+ and I want to flash them with Hypriot-OS (have a look at the site of hypriot on git). The result is a raspberry pi that is reachable with "ssh pirate@black-pearl" and Password "hypriot".
  • The flash utility of hypriot is designed for MAC's or Linux and not for Windows, so I cannot use it.
  • I have a Windows 10 Machine with WSL and Debian Linux running on WSL, so I have to write the latest image with Win32 Disk Imager on Windows to the flash-card.
  • Add only one raspi to the project at time.
  • If no cluster exists, then create one and make the first raspi to the master node.
  • If cluster exists, add next raspis to the cluster as worker nodes.

Steps

  • create branch "bootstrap" for the next steps
  • create a tree for the ansible Project

  • write ansible_hypriot_bootstrap role:
  • let raspi only be accessible with ssh-key
  • configure bash
  • add predefined ssh-keys as needed
  • set timezone
  • set locales
  • configure and start ntp
  • configure and start unbound
  • do some misc configuration steps
  • rename raspi with next node name (choose name)
  • reboot raspi (now it's accessible with new name)

  • write ansible kubernetes role:
  • k8s - Clients
  • k8s - Master
  • kubernetes-dashboard
  • put it all together
Clone this wiki locally