Skip to content

Instantly share code, notes, and snippets.

@maazghani
Last active December 19, 2020 17:24
Show Gist options
  • Save maazghani/f605d993d878093c8be3c9decc1b6d4c to your computer and use it in GitHub Desktop.
Save maazghani/f605d993d878093c8be3c9decc1b6d4c to your computer and use it in GitHub Desktop.
tailk3scale — mesh vpn for IoT run on IoT

stakeholders:

parts requests

  • 3 raspberry pi 3b+/4/zero
  • k3s - lightweight k8s for IoT/ARM
  • tailscale - software defined mesh VPN with private DNS built in

architecture

cluster initialization

download and install

curl -sfL https://get.k3s.io | sh -
# Check for Ready node, 
takes maybe 30 seconds
k3s kubectl get node

setup nodes

K3S_TOKEN=SECRET k3s server --server https://masters-up

run on each

source: https://rancher.com/docs/k3s/latest/en/installation/ha-embedded/

plug A into B

  • currently tailscale is available as a downloadable binary for Raspbian but we need to containerize it to run on our k8s cluster
  • two options
Raspbian Buster (for Raspbery Pi)

# Add Tailscale's GPG key
curl https://pkgs.tailscale.com/unstable/raspbian/buster.gpg | sudo apt-key add -
# Add the tailscale repository
curl https://pkgs.tailscale.com/unstable/raspbian/buster.list | sudo tee /etc/apt/sources.list.d/tailscale.list
# Install Tailscale
sudo apt-get update && sudo apt-get install tailscale
# Start Tailscale!
sudo tailscale up

assemble

y tho

learn & POC

  • lightweight k8s
  • mesh VPN for setting up a home base machine as a jumpserver for making ipad pro into a thinclient
  • software-defined networks
  • hardware maintenance
  • how easy to automate cluster management?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment