Giter Club home page Giter Club logo

k3p4's Introduction

k3p4

K3P4 - 4 node Raspberry Pi Cluster using k3s

Goal of this project:

I want to learn k8s deployments and hosting various apps on it, and I want to mess around with raspberry pis.

K3s will work on a pi cluster, and it's easy to get started.

Deployment idea #1

Put my Deno Fresh Blog in to k3s.

How to Dockerize Fresh app

Github docker build job ?

How do ingress? Do I need an nginx ingress thingy pointed to fresh site?

Setting up Raspberry Pis

All pis in my build are 'Raspberry Pi 4 Model B 8gb arm64' boards, with 32gb sandisk cards.

OS: Raspberry Pi OS Bookworm (~Debian 12)

I'm still figuring out k3s and networking and everything else.

Needed software

sudo apt update && sudo apt install curl vim python3-pip -y && sudo apt full-upgrade -y && sudo reboot

Patch Configs for k3s

# Add cgroups
sudo vim /boot/firmware/cmdline.txt

# Add this to the existing oneliner
cgroup_memory=1 cgroup_enable=memory

# close file

# Turn off / remove bluetooth
sudo vim /boot/firmware/config.txt`

# Disable bluetooth
dtoverlay=disable-bt
# Disable wifi
#dtoverlay=disable-wifi

# close file

sudo systemctl disable hciuart.service
sudo systemctl disable bluetooth.service
sudo apt purge bluez
sudo apt autoremove
sudo reboot

Setting Static IPs

ip r | grep default for dns server ip

ifconfig to see device interaces

For Raspberry Pi OS Bulleyes or lower, change dhcpcd settings

sudo vim /etc/dhcpcd.conf

interface eth0
metric 300
static ip_address=<your static ip>/24
static routers=<your router ip>
static domain_name_servers=<your dns ip>

interface wlan0
metric 200
static ip_address=<other static ip>/24
static routers=<your router ip>
static domain_name_servers=<your dns ip>
# close file

sudo reboot

Raspberry Pi OS Bookworm uses Network Manager instead of dhcpcd.service, use sudo nmtui to set static ip's.

Or this

# for static wifi ip with imager configed wifi
sudo vim /etc/NetworkManager/system-connections/preconfigured.nmconnection

[ipv4]
address1=<your static ip>/24,<your router ip>
dns=<your dns ip>;1.1.1.1;8.8.8.8;
dns-search=ht.home;
may-fail=false
method=manual
# close file

# for static ethernet
sudo vim /etc/NetworkManager/system-connections/Wired\ connection\ 1.nmconnection

[ipv4]
address1=<other static ip>/24,<router ip>
dns=<dns ip>;1.1.1.1;8.8.8.8;
dns-search=ht.home;
may-fail=false
method=manual
# close file

sudo reboot

Install k3s on master node

curl -sfl https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -s

get your k3s token sudo cat /var/lib/rancher/k3s/server/node-token

Install k3s on worker / agent nodes

curl -sfL https://get.k3s.io | K3S_URL=https://<master static ip addr>:6443 K3S_TOKEN=<master k3s token> sh -

ssh key

Copy the ssh key you want to use with ansible

# this should be on your main machine
ssh-copy-id -i ~/.ssh/id_rsa.pub pi@<k3p4 hostname here>

References

k3p4's People

Contributors

fitzypop 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.