Giter VIP home page Giter VIP logo

woodkubernetes's Introduction

woodKubernetes

Work in Progress

Idea

  • High Availability of LXD containers without LXD cluster and/or CephFS

Why

  • Kubernetes is way to complex for my use case
  • LXD Cluster needs CephFS storage backend + won't work well on higher latency

Software

  • LXD for running the containers
  • rqlite to store containers info/leader choice

Features

  • High Availability
  • Port Forwarding
  • ACME Support (LE)

Requirements

  • 3+ Nodes with Ubuntu 20.04 or Debian 10
  • Each node should have at least 1GB of Memory
  • Mesh VPN connecting them together (Tinc/VpnCloud/Wireguard)

Prepare
Rename servers.example.json to servers.json and fill it up

Setup

  1. Deploy LXD on all Nodes and init
    By default a loop file is used with lvm
python3 wood.py lxd
  1. Deploy rqlite on all Nodes
    Check if the version is up to date
python3 wood.py rqlite

Check the rqlite cluster status:

curl rqlite:4003/nodes?pretty
  1. Deploy woodKubernetes
python3 wood.py wood
  1. SSH into any machine and Initialize the Database
su woodKubernetes -c "cd /home/woodKubernetes/woodKubernetes/ && python3 cli.py init"
  1. Deploy the primary service
python3 wood.py service
  1. Deploy the first container

Before you deploy, you should preload the os images you need.
This results in faster deploy times and don't affect you if the image server is down or slow.

nginx example

python3 cli.py machine add one debian/buster 256 80:80,443:443 \
"apt-get install nginx -y"

znc example

python3 cli.py machine add one debian/buster 256 1025:1025 \
"apt-get install wget znc -y && wget -qO - https://gist.githubusercontent.com/Ne00n/1fa5851bb86927e68ac82015da5a6744/raw/3232ac5c2350fdf5e2e17996752d68aa9142fa7f/znc%2520test%2520deploy | bash"

If you want no port forwarding use 0 instead

preload
preload os templates

python3 wood.py preload

Update

python3 wood.py update

woodkubernetes's People

Contributors

ne00n avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

woodkubernetes's Issues

Possible idea

I am a longtime LXC/LXD user.

I've used many different Mesh VPN solutions (vpncloud, nebula, wireguard etc)

All are relatively complex to configure or update which hinders adoption.

Recently, I found Hyprspace:

https://github.com/hyprspace/hyprspace

This is unique because you don't have to configure or add anything to the LXD Host.

Install Hyprspace in any/all LXD containers local or remote.

Edit each LXD container's /etc/hyprspace/hyprspace.yaml (see the GitHub README.md) and change the IP

(10.x.x.x, 172.16.x.x or 192.168.x.x)

In the PEER section of each YAML add the:

ID & IP from the Hyprspace YAML of some local/remote LXD container's Hyprspace YAML you want "this" LXD Container to PEER with.

In each YAML's peer section, add as many PEERS as you want.

Obviously, you could automate much of this configuration in lots of ways.
cloud-init, Ansible etc etc

When you execute the command to bring up each Container's Hyprspace Interface...

All LXD containers will connect using the Hyprspace IP network you assigned in each YAML.

Connection usually takes 20-60sec

Afterwards, each local/remote LXD Container will be directly interconnected in a fully encrypted MESH VPN.

I've tested w LXD Host servers on Digital Ocean, Hetzner cloud in Germany & my local servers and performance is great and config is stupid simple.

Anyway wanted to fyi you in case it helps your project.

A closely similar project to Hyprspace architecturally (IPFS, DHT, libp2p) but which also has an API so it can be integrated is EDGEVPN:

https://github.com/mudler/edgevpn

Brian

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.