Git Product home page Git Product logo

kubepi's Introduction

kubepi

This project is a highly opinionated automation for kubernetes running on 2 or more raspberry pis.

The setup is glued together using:

  • ubuntu for raspberry pi
  • cloud-init (built into ubuntu image)
  • k3s kubernetes cluster
  • zerotier virtual peer to peer network (for accessing remotely)

Overview

The scripts in this repo are used to generate configuration needed for a fully automated kubernetes cluster of raspberry pis, and to then flash this to sd card.

Dependencies

The main requirement on top of a macos userspace is flash and yq. Both can be installed with Homebrew. Finally, if you want to use the zerotier integration, make sure you have an account and a network before starting.

Usage

create a file called config.yaml by copying the config.yaml.example file and replacing at least the following keys:

  • user.username - Your chosen username
  • user.sshPubKey - Your SSH public key
  • user.passwordHash - a password hash in a crypt compatible format.
  • zerotier_network - Your zerotier network (or remove the line from config if not desired)
  • token - this is a token for your k3s cluster communication. Make it up, but securely. I used pwgen -s 32
  • flux.token - your github pat token
  • flux.owner - your github username
  • flux.repository - your github repository

But review all the values in the config file. Note: some are optional (such as flux and zerotier_network). The default setup here is for a 4 node cluster, with 1 acting as controlplane

then run ./flash_kubernetes_image.sh node_name with your sdcard inserted. follow the prompts, wait until it's finished and repeat for all your node sdcards.

Finally, insert the cards in each raspberrypi and turn it on.

Can I configure this differently?

While there is a certain amount that is configurable, it is mostly an illusion - I use this to make a reproducable test environment for myself and is not tested under other circumstances.

I recommend testing out any non-default configuration as it stands a high chance of not working, and I welcome prs to tidy this up and make it better.

kubepi's People

Contributors

scottaubrey avatar

Watchers

 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.