From 4a8ad1317ec91347f12afe2645e4251609fa162e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 11 May 2025 11:37:00 +0300 Subject: Update content for md --- about/resources.md | 194 ++--- gemfeed/.ruby-lsp/Gemfile | 6 + gemfeed/.ruby-lsp/Gemfile.lock | 41 + ...6-04-09-jails-and-zfs-on-freebsd-with-puppet.md | 1 + ...2022-07-30-lets-encrypt-with-openbsd-and-rex.md | 1 + .../2024-01-13-one-reason-why-i-love-openbsd.md | 1 + ...24-04-01-KISS-high-availability-with-OpenBSD.md | 1 + ...024-11-17-f3s-kubernetes-with-freebsd-part-1.md | 4 +- ...024-12-03-f3s-kubernetes-with-freebsd-part-2.md | 4 +- ...025-02-01-f3s-kubernetes-with-freebsd-part-3.md | 2 + ...025-04-05-f3s-kubernetes-with-freebsd-part-4.md | 4 +- ...025-05-11-f3s-kubernetes-with-freebsd-part-5.md | 946 +++++++++++++++++++++ gemfeed/DRAFT-kubernetes-with-freebsd-part-5.md | 79 -- .../wireguard.svg | 2 + gemfeed/index.md | 1 + index.md | 3 +- uptime-stats.md | 52 +- 17 files changed, 1136 insertions(+), 206 deletions(-) create mode 100644 gemfeed/.ruby-lsp/Gemfile create mode 100644 gemfeed/.ruby-lsp/Gemfile.lock create mode 100644 gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.md delete mode 100644 gemfeed/DRAFT-kubernetes-with-freebsd-part-5.md create mode 100644 gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg diff --git a/about/resources.md b/about/resources.md index c32b3364..40d0c2e7 100644 --- a/about/resources.md +++ b/about/resources.md @@ -36,103 +36,103 @@ You won't find any links on this site because, over time, the links will break. In random order: -* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly -* Java ist auch eine Insel; Christian Ullenboom; -* Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson -* Perl New Features; Joshua McAdams, brian d foy; Perl School -* Ultimate Go Notebook; Bill Kennedy -* Programming Ruby 3.3 (5th Edition); Noel Rappin, with Dave Thomas; The Pragmatic Bookshelf * Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications * Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press -* The Docker Book; James Turnbull; Kindle -* Pro Puppet; James Turnbull, Jeffrey McCune; Apress -* DNS and BIND; Cricket Liu; O'Reilly -* Developing Games in Java; David Brackeen and others...; New Riders -* Raku Recipes; J.J. Merelo; Apress -* Polished Ruby Programming; Jeremy Evans; Packt Publishing -* Effective Java; Joshua Bloch; Addison-Wesley Professional -* Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly -* Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers -* Terraform Cookbook; Mikael Krief; Packt Publishing +* Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner +* Site Reliability Engineering; How Google runs production systems; O'Reilly +* Effective awk programming; Arnold Robbins; O'Reilly +* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible +* Systemprogrammierung in Go; Frank Müller; dpunkt +* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications +* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly +* Ultimate Go Notebook; Bill Kennedy +* Java ist auch eine Insel; Christian Ullenboom; +* Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson +* Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly * Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press -* Leanring eBPF; Liz Rice; O'Reilly -* Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly +* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly +* Effective Java; Joshua Bloch; Addison-Wesley Professional * The Kubernetes Book; Nigel Poulton; Unabridged Audiobook -* Higher Order Perl; Mark Dominus; Morgan Kaufmann -* The Practise of System and Network Administration; Thomas A. Limoncelli, Christina J. Hogan, Strata R. Chalup; Addison-Wesley Professional Pro Git; Scott Chacon, Ben Straub; Apress * Modern Perl; Chromatic ; Onyx Neon Press -* Raku Fundamentals; Moritz Lenz; Apress -* Data Science at the Command Line; Jeroen Janssens; O'Reilly -* Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly -* The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton * Concurrency in Go; Katherine Cox-Buday; O'Reilly -* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications -* C++ Programming Language; Bjarne Stroustrup; -* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible -* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly -* Systemprogrammierung in Go; Frank Müller; dpunkt -* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers -* Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner * The Pragmatic Programmer; David Thomas; Addison-Wesley -* Effective awk programming; Arnold Robbins; O'Reilly -* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible +* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly +* C++ Programming Language; Bjarne Stroustrup; +* Developing Games in Java; David Brackeen and others...; New Riders +* Raku Recipes; J.J. Merelo; Apress +* The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton +* DNS and BIND; Cricket Liu; O'Reilly * Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt +* Higher Order Perl; Mark Dominus; Morgan Kaufmann +* The Practise of System and Network Administration; Thomas A. Limoncelli, Christina J. Hogan, Strata R. Chalup; Addison-Wesley Professional Pro Git; Scott Chacon, Ben Straub; Apress * The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional +* Terraform Cookbook; Mikael Krief; Packt Publishing +* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible +* Programming Ruby 3.3 (5th Edition); Noel Rappin, with Dave Thomas; The Pragmatic Bookshelf +* Raku Fundamentals; Moritz Lenz; Apress +* Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly +* Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly +* Polished Ruby Programming; Jeremy Evans; Packt Publishing +* Pro Puppet; James Turnbull, Jeffrey McCune; Apress +* Leanring eBPF; Liz Rice; O'Reilly +* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly +* Data Science at the Command Line; Jeroen Janssens; O'Reilly +* Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers * Funktionale Programmierung; Peter Pepper; Springer -* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly -* Site Reliability Engineering; How Google runs production systems; O'Reilly -* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly +* The Docker Book; James Turnbull; Kindle +* Perl New Features; Joshua McAdams, brian d foy; Perl School +* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers ## Technical references I didn't read them from the beginning to the end, but I am using them to look up things. The books are in random order: +* The Linux Programming Interface; Michael Kerrisk; No Starch Press +* Relayd and Httpd Mastery; Michael W Lucas +* Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly +* BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley * Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley -* Go: Design Patterns for Real-World Projects; Mat Ryer; Packt * Implementing Service Level Objectives; Alex Hidalgo; O'Reilly +* Go: Design Patterns for Real-World Projects; Mat Ryer; Packt * Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly -* BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley -* Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly -* Relayd and Httpd Mastery; Michael W Lucas -* The Linux Programming Interface; Michael Kerrisk; No Starch Press ## Self-development and soft-skills books In random order: -* Slow Productivity; Cal Newport; Penguin Random House -* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press -* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd +* The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select +* Deep Work; Cal Newport; Piatkus * Eat That Frog!; Brian Tracy; Hodder Paperbacks -* Atomic Habits; James Clear; Random House Business +* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press +* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books +* The Bullet Journal Method; Ryder Carroll; Fourth Estate * Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly -* Ultralearning; Anna Laurent; Self-published via Amazon +* Ultralearning; Scott Young; Thorsons +* The Power of Now; Eckhard Tolle; Yellow Kite * Psycho-Cybernetics; Maxwell Maltz; Perigee Books -* So Good They Can't Ignore You; Cal Newport; Business Plus -* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books -* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne -* The Good Enough Job; Simone Stolzoff; Ebury Edge -* Deep Work; Cal Newport; Piatkus * Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing +* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd +* 101 Essays that change the way you think; Brianna Wiest; Audible * The Joy of Missing Out; Christina Crook; New Society Publishers -* Solve for Happy; Mo Gawdat (RE-READ 1ST TIME) * The Off Switch; Mark Cropley; Virgin Books (RE-READ 1ST TIME) +* The Good Enough Job; Simone Stolzoff; Ebury Edge * The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook -* The Bullet Journal Method; Ryder Carroll; Fourth Estate -* The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK -* Ultralearning; Scott Young; Thorsons +* Stop starting, start finishing; Arne Roock; Lean-Kanban University +* Eat That Frog; Brian Tracy +* Solve for Happy; Mo Gawdat (RE-READ 1ST TIME) +* Ultralearning; Anna Laurent; Self-published via Amazon +* Atomic Habits; James Clear; Random House Business +* Slow Productivity; Cal Newport; Penguin Random House +* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne +* Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion * Digital Minimalism; Cal Newport; Portofolio Penguin +* Getting Things Done; David Allen * Soft Skills; John Sommez; Manning Publications -* Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion -* The Power of Now; Eckhard Tolle; Yellow Kite +* So Good They Can't Ignore You; Cal Newport; Business Plus * Staff Engineer: Leadership beyond the management track; Will Larson; Audible -* 101 Essays that change the way you think; Brianna Wiest; Audible -* The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select -* Stop starting, start finishing; Arne Roock; Lean-Kanban University * Never Split the Difference; Chris Voss, Tahl Raz; Random House Business * Influence without Authority; A. Cohen, D. Bradford; Wiley -* Getting Things Done; David Allen -* Eat That Frog; Brian Tracy +* The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK [Here are notes of mine for some of the books](../notes/index.md) @@ -140,30 +140,30 @@ In random order: Some of these were in-person with exams; others were online learning lectures only. In random order: -* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online -* Protocol buffers; O'Reilly Online -* Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training -* Developing IaC with Terraform (with Live Lessons); O'Reilly Online -* Apache Tomcat Best Practises; 3-day on-site training -* Ultimate Go Programming; Bill Kennedy; O'Reilly Online * F5 Loadbalancers Training; 2-day on-site training; F5, Inc. -* MySQL Deep Dive Workshop; 2-day on-site training -* AWS Immersion Day; Amazon; 1-day interactive online training +* Functional programming lecture; Remote University of Hagen * Red Hat Certified System Administrator; Course + certification (Although I had the option, I decided not to take the next course as it is more effective to self learn what I need) * Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online -* Functional programming lecture; Remote University of Hagen -* Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon -* Structure and Interpretation of Computer Programs; Harold Abelson and more...; * The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online +* Structure and Interpretation of Computer Programs; Harold Abelson and more...; +* AWS Immersion Day; Amazon; 1-day interactive online training +* MySQL Deep Dive Workshop; 2-day on-site training +* Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon +* Apache Tomcat Best Practises; 3-day on-site training +* Protocol buffers; O'Reilly Online +* Ultimate Go Programming; Bill Kennedy; O'Reilly Online * Scripting Vim; Damian Conway; O'Reilly Online +* Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training +* Developing IaC with Terraform (with Live Lessons); O'Reilly Online +* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online ## Technical guides These are not whole books, but guides (smaller or larger) which I found very useful. in random order: -* Raku Guide at https://raku.guide * How CPUs work at https://cpu.land * Advanced Bash-Scripting Guide +* Raku Guide at https://raku.guide ## Podcasts @@ -171,56 +171,56 @@ These are not whole books, but guides (smaller or larger) which I found very use In random order: -* Modern Mentor +* Maintainable * The Changelog Podcast(s) -* Deep Questions with Cal Newport -* Hidden Brain -* Fork Around And Find Out -* Cup o' Go [Golang] * Backend Banter -* Maintainable -* Fallthrough [Golang] -* BSD Now [BSD] -* The Pragmatic Engineer Podcast * Dev Interrupted +* Hidden Brain +* BSD Now [BSD] +* Modern Mentor +* Fallthrough [Golang] * The ProdCast (Google SRE Podcast) +* Cup o' Go [Golang] +* Fork Around And Find Out +* The Pragmatic Engineer Podcast +* Deep Questions with Cal Newport ### Podcasts I liked I liked them but am not listening to them anymore. The podcasts have either "finished" (no more episodes) or I stopped listening to them due to time constraints or a shift in my interests. -* CRE: Chaosradio Express [german] * Ship It (predecessor of Fork Around And Find Out) -* Modern Mentor -* FLOSS weekly -* Go Time (predecessor of fallthrough) * Java Pub House +* Go Time (predecessor of fallthrough) +* FLOSS weekly +* CRE: Chaosradio Express [german] +* Modern Mentor ## Newsletters I like This is a mix of tech and non-tech newsletters I am subscribed to. In random order: -* Monospace Mentor -* Ruby Weekly -* The Imperfectionist +* Golang Weekly +* Changelog News * Register Spill * The Valuable Dev -* Applied Go Weekly Newsletter -* byteSizeGo +* The Pragmatic Engineer * Andreas Brandhorst Newsletter (Sci-Fi author) +* byteSizeGo +* Applied Go Weekly Newsletter +* Monospace Mentor +* The Imperfectionist * VK Newsletter -* Changelog News -* Golang Weekly -* The Pragmatic Engineer +* Ruby Weekly ## Magazines I like(d) This is a mix of tech I like(d). I may not be a current subscriber, but now and then, I buy an issue. In random order: -* Linux Magazine * freeX (not published anymore) -* LWN (online only) +* Linux Magazine * Linux User +* LWN (online only) # Formal education diff --git a/gemfeed/.ruby-lsp/Gemfile b/gemfeed/.ruby-lsp/Gemfile new file mode 100644 index 00000000..1ebf7b78 --- /dev/null +++ b/gemfeed/.ruby-lsp/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" +# This custom gemfile is automatically generated by the Ruby LSP. +# It should be automatically git ignored, but in any case: do not commit it to your repository. + +gem "ruby-lsp", require: false, group: :development +gem "debug", require: false, group: :development, platforms: :mri \ No newline at end of file diff --git a/gemfeed/.ruby-lsp/Gemfile.lock b/gemfeed/.ruby-lsp/Gemfile.lock new file mode 100644 index 00000000..ba1e1f31 --- /dev/null +++ b/gemfeed/.ruby-lsp/Gemfile.lock @@ -0,0 +1,41 @@ +GEM + remote: https://rubygems.org/ + specs: + date (3.4.1) + debug (1.10.0) + irb (~> 1.10) + reline (>= 0.3.8) + io-console (0.8.0) + irb (1.14.3) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + language_server-protocol (3.17.0.4) + logger (1.7.0) + prism (1.4.0) + psych (5.2.2) + date + stringio + rbs (3.9.3) + logger + rdoc (6.10.0) + psych (>= 4.0.0) + reline (0.6.1) + io-console (~> 0.5) + ruby-lsp (0.23.17) + language_server-protocol (~> 3.17.0) + prism (>= 1.2, < 2.0) + rbs (>= 3, < 4) + sorbet-runtime (>= 0.5.10782) + sorbet-runtime (0.5.12087) + stringio (3.1.7) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + debug + ruby-lsp + +BUNDLED WITH + 2.6.2 diff --git a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.md b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.md index f2cd771c..4b609bc8 100644 --- a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.md +++ b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.md @@ -397,6 +397,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.md b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.md index 97b0b45d..8234a0e5 100644 --- a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.md +++ b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.md @@ -676,6 +676,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.md b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.md index c5cc74ca..a6fdfb1c 100644 --- a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.md +++ b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.md @@ -51,6 +51,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.md b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.md index 880b4ab5..de244403 100644 --- a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.md +++ b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.md @@ -300,6 +300,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD and KISS related posts are: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.md b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.md index 6ce58ac3..0847feb6 100644 --- a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.md +++ b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.md @@ -12,10 +12,11 @@ These are all the posts so far: [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [![f3s logo](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png "f3s logo")](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png) -> Logo was generated by ChatGPT. +> ChatGPT generated logo.. Let's begin... @@ -160,6 +161,7 @@ Read the next post of this series: Other *BSD-related posts: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.md b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.md index 5af5d22d..a63558ce 100644 --- a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.md +++ b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.md @@ -12,10 +12,11 @@ These are all the posts so far: [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [![f3s logo](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png "f3s logo")](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png) -> Logo was generated by ChatGPT. +> ChatGPT generated logo.. Let's continue... @@ -299,6 +300,7 @@ Read the next post of this series: Other *BSD-related posts: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.md b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.md index de6e6b3b..3078edf0 100644 --- a/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.md +++ b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.md @@ -8,6 +8,7 @@ This is the third blog post about my f3s series for my self-hosting demands in m [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [![f3s logo](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png "f3s logo")](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png) @@ -360,6 +361,7 @@ See you in the next post of this series! Other BSD related posts are: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.md b/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.md index 02805072..a3e0437e 100644 --- a/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.md +++ b/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.md @@ -8,6 +8,7 @@ This is the fourth blog post about the f3s series for self-hosting demands in a [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs (You are currently reading this)](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [![f3s logo](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png "f3s logo")](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png) @@ -502,10 +503,11 @@ Future uses (out of scope for this blog series) would be additional VMs for diff This flexibility is great for keeping options open and managing different workloads without overcomplicating things. Overall, it's a nice setup for getting the most out of my hardware and keeping things running smoothly. -See you in the next blog post of this series. Maybe we will be installing highly available storage with HAST or we start setting up k3s on the Rocky Linux VMs. +See you in the next post of this series! Other *BSD-related posts: +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs (You are currently reading this)](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) [2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) [2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) diff --git a/gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.md b/gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.md new file mode 100644 index 00000000..26c68c5d --- /dev/null +++ b/gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.md @@ -0,0 +1,946 @@ +# f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network + +> Published at 2025-05-11T11:35:57+03:00 + +This is the fifth blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines. + +I will post a new entry every month or so (there are too many other side projects for more frequent updates — I bet you can understand). + +These are all the posts so far: + +[2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage](./2024-11-17-f3s-kubernetes-with-freebsd-part-1.md) +[2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) +[2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) +[2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network (You are currently reading this)](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) + +[![f3s logo](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png "f3s logo")](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png) + +> ChatGPT generated logo. + +Let's begin... + +## Table of Contents + +* [⇢ f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](#f3s-kubernetes-with-freebsd---part-5-wireguard-mesh-network) +* [⇢ ⇢ Introduction](#introduction) +* [⇢ ⇢ ⇢ Expected traffic flow](#expected-traffic-flow) +* [⇢ ⇢ Deciding on WireGuard](#deciding-on-wireguard) +* [⇢ ⇢ Base configuration](#base-configuration) +* [⇢ ⇢ ⇢ FreeBSD](#freebsd) +* [⇢ ⇢ ⇢ Rocky Linux](#rocky-linux) +* [⇢ ⇢ ⇢ OpenBSD](#openbsd) +* [⇢ ⇢ WireGuard configuration](#wireguard-configuration) +* [⇢ ⇢ ⇢ Example `wg0.conf`](#example-wg0conf) +* [⇢ ⇢ ⇢ NAT traversal and keepalive](#nat-traversal-and-keepalive) +* [⇢ ⇢ ⇢ Preshared key](#preshared-key) +* [⇢ ⇢ Mesh network generator](#mesh-network-generator) +* [⇢ ⇢ ⇢ `wireguardmeshgenerator.yaml`](#wireguardmeshgeneratoryaml) +* [⇢ ⇢ ⇢ `wireguardmeshgenerator.rb` overview](#wireguardmeshgeneratorrb-overview) +* [⇢ ⇢ Invoking the mesh network generator](#invoking-the-mesh-network-generator) +* [⇢ ⇢ ⇢ Generating the `wg0.conf` files and keys](#generating-the-wg0conf-files-and-keys) +* [⇢ ⇢ ⇢ Installing the `wg0.conf` files](#installing-the-wg0conf-files) +* [⇢ ⇢ ⇢ Re-generating mesh and installing the `wg0.conf` files again](#re-generating-mesh-and-installing-the-wg0conf-files-again) +* [⇢ ⇢ Happy WireGuard-ing](#happy-wireguard-ing) +* [⇢ ⇢ Conclusion](#conclusion) + +## Introduction + +By default, traffic within my home LAN, including traffic inside a k3s cluster, is not encrypted. While it resides in the "secure" home LAN, adopting a zero-trust policy means encryption is still preferable to ensure confidentiality and security. So we decide to secure all the traffic of all f3s participating hosts by building a mesh network of all participating hosts: + +[![Full mesh network](./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg "Full mesh network")](./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg) + +Whereas `f0`, `f1`, and `f2` are the FreeBSD base hosts, `r0`, `r1`, and `r2` are the Rocky Linux Bhyve VMs, and `blowfish` and `fishfinger` are two OpenBSD systems running on the internet (as mentioned in the first blog of this series—these systems are already built; in fact, this very blog is served by those OpenBSD systems). + +As we can see from the graph, it is a true full-mesh network, where every host has a VPN tunnel to every other host. The benefit is that we do not need to route traffic through intermediate hosts (significantly simplifying the routing configuration). However, the downside is that there is some overhead in configuring and managing all the tunnels. + +For simplicity, we also establish VPN tunnels between `f0 <-> r0`, `f1 <-> r1`, and `f2 <-> r2`. Technically, this wouldn't be strictly required since the VMs `rN` are running on the hosts `fN`, and no network traffic is leaving the box. However, it simplifies the configuration as we don't have to account for exceptions, and we are going to automate the mesh network configuration anyway (read on). + +### Expected traffic flow + +The traffic is expected to flow between the host groups through the mesh network as follows: + +* `fN <-> rN`: The traffic between the FreeBSD hosts and the Rocky Linux VMs will be routed through the VPN tunnels for persistent storage. In a later post in this series, we will set up an NFS server on the `fN` hosts. +* `fN <-> blowfish,fishfinger`: The traffic between the FreeBSD hosts and the OpenBSD host `blowfish,fishfinger` will be routed through the VPN tunnels for management. We may want to log in via the internet to set it up remotely. The VPN tunnel will also be used for monitoring purposes. +* `rN <-> blowfish,fishfinger`: The traffic between the Rocky Linux VMs and the OpenBSD host `blowfish,fishfinger` will be routed through the VPN tunnels for usage traffic. Since `k3s` will be running on the `rN` hosts, the OpenBSD servers will route the traffic through `relayd` to the services running in Kubernetes. +* `fN <-> fM`: The traffic between the FreeBSD hosts may be later used for data replication for the NFS storage. +* `rN <-> rM`: The traffic between the Rocky Linux VMs will later be used by the `k3s` cluster itself, as every `rN` will be a Kubernetes worker node. +* `blowfish <-> fishfinger`: The traffic between the OpenBSD hosts isn't strictly required for this setup, but I set it up anyway for future use cases. + +We won't cover all the details in this blog post, as we only focus on setting up the Mesh network in this blog post. Subsequent posts in this series will cover the other details. + +## Deciding on WireGuard + +I have decided to use WireGuard as the VPN technology for this purpose. + +WireGuard is a lightweight, modern, and secure VPN protocol designed for simplicity, speed, and strong cryptography. It is an excellent choice due to its minimal codebase, ease of configuration, high performance, and robust security, utilizing state-of-the-art encryption standards. WireGuard is supported on various operating systems, and its implementations are compatible with each other. Therefore, establishing WireGuard VPN tunnels between FreeBSD, Linux, and OpenBSD is seamless. This cross-platform availability makes it suitable for setups like the one described in this blog series. + +We could have used Tailscale for an easy to set up and manage the WireGuard network, but the benefits of creating our own mesh network are: + +* Learning about WireGuard configuration details +* Have full control over the setup +* Don't rely on an external provider like Tailscale (even if some of the components are open-source) +* Have even more fun along the way +* WireGuard is easy to configure on my target operating systems and, therefore, easier to maintain in the long run. +* There are no official Tailscale packages available for OpenBSD and FreeBSD. However, getting Tailscale running on these systems is still possible, though some tinkering would be required. Instead, we use that tinkering time to set up WireGuard tunnels ourselves. + +[https://en.wikipedia.org/wiki/WireGuard](https://en.wikipedia.org/wiki/WireGuard) +[https://www.wireguard.com/](https://www.wireguard.com/) +[https://tailscale.com/](https://tailscale.com/) + +[![WireGuard Logo](./f3s-kubernetes-with-freebsd-part-5/wireguard.svg "WireGuard Logo")](./f3s-kubernetes-with-freebsd-part-5/wireguard.svg) + +## Base configuration + +In the following, we prepare the base configuration for the WireGuard mesh network. We will use a similar configuration on all participating hosts, with the exception of the host IP addresses and the private keys. + +### FreeBSD + +On the FreeBSD hosts `f0`, `f1` and `f2`, similar as last time, first, we bring the system up to date: + +```sh +paul@f0:~ % doas freebsd-update fetch +paul@f0:~ % doas freebsd-update install +paul@f0:~ % doas freebsd-update -r 14.2-RELEASE upgrade +paul@f0:~ % doas freebsd-update install +paul@f0:~ % doas shutdown -r now +.. +.. +paul@f0:~ % doas pkg update +paul@f0:~ % doas pkg upgrade +paul@f0:~ % reboot +``` + +Next, we install `wireguard-tools` and configure the WireGuard service: + +```sh +paul@f0:~ % doas pkg install wireguard-tools +paul@f0:~ % doas sysrc wireguard_interfaces=wg0 +wireguard_interfaces: -> wg0 +paul@f0:~ % doas sysrc wireguard_enable=YES +wireguard_enable: -> YES +paul@f0:~ % doas mkdir -p /usr/local/etc/wireguard +paul@f0:~ % doas touch /usr/local/etc/wireguard/wg0.conf +paul@f0:~ % doas service wireguard start +paul@f0:~ % doas wg show +interface: wg0 + public key: L+V9o0fNYkMVKNqsX7spBzD/9oSvxM/C7ZCZX1jLO3Q= + private key: (hidden) + listening port: 20246 +``` + +We now have the WireGuard up and running, but it is not yet in any functional configuration. We will come back to that later. + +Next, we add all the participating WireGuard IPs to the `hosts` file. This is only convenience, so we don't have to manage an external DNS server for this: + +```sh +paul@f0:~ % cat <>/etc/hosts + +192.168.1.130 f0 f0.lan f0.lan.buetow.org +192.168.1.131 f1 f1.lan f1.lan.buetow.org +192.168.1.132 f2 f2.lan f2.lan.buetow.org + +192.168.2.130 f0.wg0 f0.wg0.wan.buetow.org +192.168.2.131 f1.wg0 f1.wg0.wan.buetow.org +192.168.2.132 f2.wg0 f2.wg0.wan.buetow.org + +192.168.2.120 r0.wg0 r0.wg0.wan.buetow.org +192.168.2.121 r1.wg0 r1.wg0.wan.buetow.org +192.168.2.122 r2.wg0 r2.wg0.wan.buetow.org + +192.168.2.110 blowfish.wg0 blowfish.wg0.wan.buetow.org +192.168.2.111 fishfinger.wg0 fishfinger.wg0.wan.buetow.org +END +``` + +Unfortunately, the SELinux policy on Rocky Linux blocks WireGuard's operation. By making the `wireguard_t` domain permissive using `semanage permissive -a wireguard_t`, SELinux will no longer enforce restrictions for WireGuard, allowing it to work as intended: + +```sh +[root@r0 ~] dnf install -y policycoreutils-python-utils +[root@r0 ~] semanage permissive -a wireguard_t +[root@r0 ~] reboot +``` + +[https://github.com/angristan/wireguard-install/discussions/499](https://github.com/angristan/wireguard-install/discussions/499) + +### OpenBSD + +Other than the FreeBSD and Rocky Linux hosts involved, my OpenBSD hosts (`blowfish` and `fishfinger`, which are running at OpenBSD Amsterdam and Hetzner on the internet) have been running already for longer, so I can't provide you with the "from scratch" installation details here. In the following, we will only focus on the additional configuration needed to set up WireGuard: + +```sh +blowfish$ doas pkg_add wireguard-tools +blowfish$ doas mkdir /etc/wireguard +blowfish$ doas touch /etc/wireguard/wg0.conf +blowsish$ cat < By default, WireGuard tries to be as silent as possible when not being used; it is not a chatty protocol. For the most part, it only transmits data when a peer wishes to send packets. When it's not being asked to send packets, it stops sending packets until it is asked again. In the majority of configurations, this works well. However, when a peer is behind NAT or a firewall, it might wish to be able to receive incoming packets even when it is not sending any packets. Because NAT and stateful firewalls keep track of "connections", if a peer behind NAT or a firewall wishes to receive incoming packets, he must keep the NAT/firewall mapping valid, by periodically sending keepalive packets. This is called persistent keepalives. When this option is enabled, a keepalive packet is sent to the server endpoint once every interval seconds. A sensible interval that works with a wide variety of firewalls is 25 seconds. Setting it to 0 turns the feature off, which is the default, since most users will not need this, and it makes WireGuard slightly more chatty. This feature may be specified by adding the PersistentKeepalive = field to a peer in the configuration file, or setting persistent-keepalive at the command line. If you don't need this feature, don't enable it. But if you're behind NAT or a firewall and you want to receive incoming connections long after network traffic has gone silent, this option will keep the "connection" open in the eyes of NAT. + +That's why you see `PersistentKeepAlive = 25` in the `blowfish` and `fishfinger` peer configurations. This means that every 25 seconds, a keep-alive signal is sent over the tunnel to maintain its connection. If the tunnel is not yet established, it will be created within 25 seconds latest. + +Without this, we might never have a VPN tunnel open, as the systems in the LAN may not actively attempt to contact `blowfish` and `fishfinger` on their own. In fact, the opposite would likely occur, with the traffic flowing inward instead of outward (this is beyond the scope of this blog post but will be covered in a later post in this series!). + +### Preshared key + +In a WireGuard configuration, the PSK (preshared key) is an optional additional layer of symmetric encryption used alongside the standard public key cryptography. It is a shared secret known to both peers that enhances security by requiring an attacker to compromise both the private keys and the PSK to decrypt communication. While optional, using a PSK is better as it strengthens the cryptographic security, mitigating risks of potential vulnerabilities in the key exchange process. + +So, because it's better, we are using it. + +## Mesh network generator + +Manually generating `wg0.conf` files for every peer in a mesh network setup is cumbersome because each peer requires its own unique public/private key pair and a preshared key for each VPN tunnel (resulting in 29 preshared keys for 8 hosts). This complexity scales exponentially with the number of peers as the relationships between all peers must be explicitly defined, including their unique configurations such as `AllowedIPs` and `Endpoint` and optional settings like `PersistentKeepalive`. Automating the process ensures consistency, reduces human error, saves considerable time, and allows for centralized management of configuration files. + +Instead, a script can handle key generation, coordinate relationships, and generate all necessary configuration files simultaneously, making it scalable and far less error-prone. + +I have written a Ruby script `wireguardmeshgenerator.rb` to do this for our purposes: + +[https://codeberg.org/snonux/wireguardmeshgenerator](https://codeberg.org/snonux/wireguardmeshgenerator) + +I use Fedora Linux as my main driver on my personal Laptop, so the script was developed and tested only on Fedora Linux. However, it should also work on other Linux and Unix-like systems. + +To set up the mesh generator on Fedora Linux, we run the following: + +```sh +> git clone https://codeberg.org/snonux/wireguardmeshgenerator +> cd ./wireguardmeshgenerator +> bundle install +> sudo dnf install -y wireguard-tools +``` + +This assumes that Ruby and the `bundler` gem are already installed. If not, refer to the docs of your distribution. + +### `wireguardmeshgenerator.yaml` + +The file `wireguardmeshgenerator.yaml` configures the mesh generator script. + +``` +--- +hosts: + f0: + os: FreeBSD + ssh: + user: paul + conf_dir: /usr/local/etc/wireguard + sudo_cmd: doas + reload_cmd: service wireguard reload + lan: + domain: 'lan.buetow.org' + ip: '192.168.1.130' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.130' + f1: + os: FreeBSD + ssh: + user: paul + conf_dir: /usr/local/etc/wireguard + sudo_cmd: doas + reload_cmd: service wireguard reload + lan: + domain: 'lan.buetow.org' + ip: '192.168.1.131' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.131' + f2: + os: FreeBSD + ssh: + user: paul + conf_dir: /usr/local/etc/wireguard + sudo_cmd: doas + reload_cmd: service wireguard reload + lan: + domain: 'lan.buetow.org' + ip: '192.168.1.132' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.132' + r0: + os: Linux + ssh: + user: root + conf_dir: /etc/wireguard + sudo_cmd: + reload_cmd: systemctl reload wg-quick@wg0.service + lan: + domain: 'lan.buetow.org' + ip: '192.168.1.120' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.120' + r1: + os: Linux + ssh: + user: root + conf_dir: /etc/wireguard + sudo_cmd: + reload_cmd: systemctl reload wg-quick@wg0.service + lan: + domain: 'lan.buetow.org' + ip: '192.168.1.121' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.121' + r2: + os: Linux + ssh: + user: root + conf_dir: /etc/wireguard + sudo_cmd: + reload_cmd: systemctl reload wg-quick@wg0.service + lan: + domain: 'lan.buetow.org' + ip: '192.168.1.122' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.122' + blowfish: + os: OpenBSD + ssh: + user: rex + conf_dir: /etc/wireguard + sudo_cmd: doas + reload_cmd: sh /etc/netstart wg0 + internet: + domain: 'buetow.org' + ip: '23.88.35.144' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.110' + fishfinger: + os: OpenBSD + ssh: + user: rex + conf_dir: /etc/wireguard + sudo_cmd: doas + reload_cmd: sh /etc/netstart wg0 + internet: + domain: 'buetow.org' + ip: '46.23.94.99' + wg0: + domain: 'wg0.wan.buetow.org' + ip: '192.168.2.111' +``` + +The file specifies details such as SSH user settings, configuration directories, sudo or reload commands, and IP/domain assignments for both internal LAN-facing interfaces and WireGuard (`wg0`) interfaces. Each host is assigned specific roles, including internal participants and publicly accessible nodes with internet-facing IPs, enabling the creation of a fully connected mesh VPN. + +### `wireguardmeshgenerator.rb` overview + +The `wireguardmeshgenerator.rb` script consists of the following base classes: + +* `KeyTool`: Manages WireGuard key generation and retrieval. It ensures the presence of public/private key pairs and preshared keys (PSKs). If keys are missing, it generates them using the `wg` tool. It provides methods to read the public/private keys and retrieve or generate a PSK for communication with a peer. The keys are stored in a temp directory on the system from where the generator is run. +* `PeerSnippet`: A `Struct` representing the configuration for a single WireGuard peer in the mesh. Based on the provided attributes and configuration, it generates the peer's WireGuard configuration, including public key, PSK, allowed IPs, endpoint, and keepalive settings. +* `WireguardConfig`: This function generates WireGuard configuration files for the specified host in the mesh network. It includes the `[Interface]` section for the host itself and the `[Peer]` sections for all other peers. It can also clean up generated files and directories and create the required directory structure for storing configuration files locally on the system from which the script is run. +* `InstallConfig`: Handles uploading, installing, and restarting the WireGuard service on remote hosts using SSH and SCP. It ensures the configuration file is uploaded to the remote machine, the necessary directories are present and correctly configured, and the WireGuard service reloads with the new configuration. + +At the end (if you want to see the code for the stuff listed above, go to the Git repo and have a look), we glue it all together in this block: + +```ruby +begin + options = { hosts: [] } + OptionParser.new do |opts| + opts.banner = 'Usage: wireguardmeshgenerator.rb [options]' + opts.on('--generate', 'Generate Wireguard configs') do + options[:generate] = true + end + opts.on('--install', 'Install Wireguard configs') do + options[:install] = true + end + opts.on('--clean', 'Clean Wireguard configs') do + options[:clean] = true + end + opts.on('--hosts=HOSTS', 'Comma separated hosts to configure') do |hosts| + options[:hosts] = hosts.split(',') + end + end.parse! + + conf = YAML.load_file('wireguardmeshgenerator.yaml').freeze + conf['hosts'].keys.select { options[:hosts].empty? || options[:hosts].include?(_1) } + .each do |host| + # Generate Wireguard configuration for the host reload! + WireguardConfig.new(host, conf['hosts']).generate! if options[:generate] + # Install Wireguard configuration for the host. + InstallConfig.new(host, conf['hosts']).upload!.install!.reload! if options[:install] + # Clean Wireguard configuration for the host. + WireguardConfig.new(host, conf['hosts']).clean! if options[:clean] + end +rescue StandardError => e + puts "Error: #{e.message}" + puts e.backtrace.join("\n") + exit 2 +end +``` + +And we also have a `Rakefile`: + +```ruby +task :generate do + ruby 'wireguardmeshgenerator.rb', '--generate' +end + +task :clean do + ruby 'wireguardmeshgenerator.rb', '--clean' +end + +task :install do + ruby 'wireguardmeshgenerator.rb', '--install' +end + +task default: :generate +``` + + +## Invoking the mesh network generator + +### Generating the `wg0.conf` files and keys + +To generate everything (the `wg0.conf` of all participating hosts, including all keys involved), we run the following: + +```sh +> rake generate +/usr/bin/ruby wireguardmeshgenerator.rb --generate +Generating dist/f0/etc/wireguard/wg0.conf +Generating dist/f1/etc/wireguard/wg0.conf +Generating dist/f2/etc/wireguard/wg0.conf +Generating dist/r0/etc/wireguard/wg0.conf +Generating dist/r1/etc/wireguard/wg0.conf +Generating dist/r2/etc/wireguard/wg0.conf +Generating dist/blowfish/etc/wireguard/wg0.conf +Generating dist/fishfinger/etc/wireguard/wg0.conf +``` + +It generated all the `wg0.conf` files listed in the output, plus those keys: + +```sh +> find keys/ -type f +keys/f0/priv.key +keys/f0/pub.key +keys/psk/f0_f1.key +keys/psk/f0_f2.key +keys/psk/f0_r0.key +keys/psk/f0_r1.key +keys/psk/f0_r2.key +keys/psk/blowfish_f0.key +keys/psk/f0_fishfinger.key +keys/psk/f1_f2.key +keys/psk/f1_r0.key +keys/psk/f1_r1.key +keys/psk/f1_r2.key +keys/psk/blowfish_f1.key +keys/psk/f1_fishfinger.key +keys/psk/f2_r0.key +keys/psk/f2_r1.key +keys/psk/f2_r2.key +keys/psk/blowfish_f2.key +keys/psk/f2_fishfinger.key +keys/psk/r0_r1.key +keys/psk/r0_r2.key +keys/psk/blowfish_r0.key +keys/psk/fishfinger_r0.key +keys/psk/r1_r2.key +keys/psk/blowfish_r1.key +keys/psk/fishfinger_r1.key +keys/psk/blowfish_r2.key +keys/psk/fishfinger_r2.key +keys/psk/blowfish_fishfinger.key +keys/f1/priv.key +keys/f1/pub.key +keys/f2/priv.key +keys/f2/pub.key +keys/r0/priv.key +keys/r0/pub.key +keys/r1/priv.key +keys/r1/pub.key +keys/r2/priv.key +keys/r2/pub.key +keys/blowfish/priv.key +keys/blowfish/pub.key +keys/fishfinger/priv.key +keys/fishfinger/pub.key +``` + +Those keys are embedded in the resulting `wg0.conf`, so later, we only need to install the `wg0.conf` files and not all the keys individually. + +### Installing the `wg0.conf` files + +Uploading the `wg0.conf` files to the participating hosts and reloading WireGuard on them is then just a matter of executing (this expects, that all participating hosts are up and running): + +```sh +> rake install +/usr/bin/ruby wireguardmeshgenerator.rb --install +Uploading dist/f0/etc/wireguard/wg0.conf to f0.lan.buetow.org:. +Installing Wireguard config on f0 +Uploading cmd.sh to f0.lan.buetow.org:. ++ [ ! -d /usr/local/etc/wireguard ] ++ doas chmod 700 /usr/local/etc/wireguard ++ doas mv -v wg0.conf /usr/local/etc/wireguard +wg0.conf -> /usr/local/etc/wireguard/wg0.conf ++ doas chmod 644 /usr/local/etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on f0 +Uploading cmd.sh to f0.lan.buetow.org:. ++ doas service wireguard reload ++ rm cmd.sh +Uploading dist/f1/etc/wireguard/wg0.conf to f1.lan.buetow.org:. +Installing Wireguard config on f1 +Uploading cmd.sh to f1.lan.buetow.org:. ++ [ ! -d /usr/local/etc/wireguard ] ++ doas chmod 700 /usr/local/etc/wireguard ++ doas mv -v wg0.conf /usr/local/etc/wireguard +wg0.conf -> /usr/local/etc/wireguard/wg0.conf ++ doas chmod 644 /usr/local/etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on f1 +Uploading cmd.sh to f1.lan.buetow.org:. ++ doas service wireguard reload ++ rm cmd.sh +Uploading dist/f2/etc/wireguard/wg0.conf to f2.lan.buetow.org:. +Installing Wireguard config on f2 +Uploading cmd.sh to f2.lan.buetow.org:. ++ [ ! -d /usr/local/etc/wireguard ] ++ doas chmod 700 /usr/local/etc/wireguard ++ doas mv -v wg0.conf /usr/local/etc/wireguard +wg0.conf -> /usr/local/etc/wireguard/wg0.conf ++ doas chmod 644 /usr/local/etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on f2 +Uploading cmd.sh to f2.lan.buetow.org:. ++ doas service wireguard reload ++ rm cmd.sh +Uploading dist/r0/etc/wireguard/wg0.conf to r0.lan.buetow.org:. +Installing Wireguard config on r0 +Uploading cmd.sh to r0.lan.buetow.org:. ++ '[' '!' -d /etc/wireguard ']' ++ chmod 700 /etc/wireguard ++ mv -v wg0.conf /etc/wireguard +renamed 'wg0.conf' -> '/etc/wireguard/wg0.conf' ++ chmod 644 /etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on r0 +Uploading cmd.sh to r0.lan.buetow.org:. ++ systemctl reload wg-quick@wg0.service ++ rm cmd.sh +Uploading dist/r1/etc/wireguard/wg0.conf to r1.lan.buetow.org:. +Installing Wireguard config on r1 +Uploading cmd.sh to r1.lan.buetow.org:. ++ '[' '!' -d /etc/wireguard ']' ++ chmod 700 /etc/wireguard ++ mv -v wg0.conf /etc/wireguard +renamed 'wg0.conf' -> '/etc/wireguard/wg0.conf' ++ chmod 644 /etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on r1 +Uploading cmd.sh to r1.lan.buetow.org:. ++ systemctl reload wg-quick@wg0.service ++ rm cmd.sh +Uploading dist/r2/etc/wireguard/wg0.conf to r2.lan.buetow.org:. +Installing Wireguard config on r2 +Uploading cmd.sh to r2.lan.buetow.org:. ++ '[' '!' -d /etc/wireguard ']' ++ chmod 700 /etc/wireguard ++ mv -v wg0.conf /etc/wireguard +renamed 'wg0.conf' -> '/etc/wireguard/wg0.conf' ++ chmod 644 /etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on r2 +Uploading cmd.sh to r2.lan.buetow.org:. ++ systemctl reload wg-quick@wg0.service ++ rm cmd.sh +Uploading dist/blowfish/etc/wireguard/wg0.conf to blowfish.buetow.org:. +Installing Wireguard config on blowfish +Uploading cmd.sh to blowfish.buetow.org:. ++ [ ! -d /etc/wireguard ] ++ doas chmod 700 /etc/wireguard ++ doas mv -v wg0.conf /etc/wireguard +wg0.conf -> /etc/wireguard/wg0.conf ++ doas chmod 644 /etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on blowfish +Uploading cmd.sh to blowfish.buetow.org:. ++ doas sh /etc/netstart wg0 ++ rm cmd.sh +Uploading dist/fishfinger/etc/wireguard/wg0.conf to fishfinger.buetow.org:. +Installing Wireguard config on fishfinger +Uploading cmd.sh to fishfinger.buetow.org:. ++ [ ! -d /etc/wireguard ] ++ doas chmod 700 /etc/wireguard ++ doas mv -v wg0.conf /etc/wireguard +wg0.conf -> /etc/wireguard/wg0.conf ++ doas chmod 644 /etc/wireguard/wg0.conf ++ rm cmd.sh +Reloading Wireguard on fishfinger +Uploading cmd.sh to fishfinger.buetow.org:. ++ doas sh /etc/netstart wg0 ++ rm cmd.sh +``` + +### Re-generating mesh and installing the `wg0.conf` files again + +The mesh network can be re-generated and re-installed as follows: + +```sh +> rake clean +> rake generate +> rake install +``` + +That would also delete and re-generate all the keys involved. + +## Happy WireGuard-ing + +All is set up now. E.g. on `f0`: + +```sh +paul@f0:~ % doas wg show +interface: wg0 + public key: Jm6YItMt94++dIeOyVi1I9AhNt2qQcryxCZezoX7X2Y= + private key: (hidden) + listening port: 56709 + +peer: 8PvGZH1NohHpZPVJyjhctBX9xblsNvYBhpg68FsFcns= + preshared key: (hidden) + endpoint: 46.23.94.99:56709 + allowed ips: 192.168.2.111/32 + latest handshake: 1 minute, 46 seconds ago + transfer: 124 B received, 1.75 KiB sent + persistent keepalive: every 25 seconds + +peer: Xow+d3qVXgUMk4pcRSQ6Fe+vhYBa3VDyHX/4jrGoKns= + preshared key: (hidden) + endpoint: 23.88.35.144:56709 + allowed ips: 192.168.2.110/32 + latest handshake: 1 minute, 52 seconds ago + transfer: 124 B received, 1.60 KiB sent + persistent keepalive: every 25 seconds + +peer: s3e93XoY7dPUQgLiVO4d8x/SRCFgEew+/wP7+zwgehI= + preshared key: (hidden) + endpoint: 192.168.1.120:56709 + allowed ips: 192.168.2.120/32 + +peer: 2htXdNcxzpI2FdPDJy4T4VGtm1wpMEQu1AkQHjNY6F8= + preshared key: (hidden) + endpoint: 192.168.1.131:56709 + allowed ips: 192.168.2.131/32 + +peer: 0Y/H20W8YIbF7DA1sMwMacLI8WS9yG+1/QO7m2oyllg= + preshared key: (hidden) + endpoint: 192.168.1.122:56709 + allowed ips: 192.168.2.122/32 + +peer: Hhy9kMPOOjChXV2RA5WeCGs+J0FE3rcNPDw/TLSn7i8= + preshared key: (hidden) + endpoint: 192.168.1.121:56709 + allowed ips: 192.168.2.121/32 + +peer: SlGVsACE1wiaRoGvCR3f7AuHfRS+1jjhS+YwEJ2HvF0= + preshared key: (hidden) + endpoint: 192.168.1.132:56709 + allowed ips: 192.168.2.132/32 +``` + +All the hosts are pingable as well, e.g.: + +```sh +paul@f0:~ % foreach peer ( f1 f2 r0 r1 r2 blowfish fishfinger ) +foreach? ping -c2 $peer.wg0 +foreach? echo +foreach? end +PING f1.wg0 (192.168.2.131): 56 data bytes +64 bytes from 192.168.2.131: icmp_seq=0 ttl=64 time=0.334 ms +64 bytes from 192.168.2.131: icmp_seq=1 ttl=64 time=0.260 ms + +--- f1.wg0 ping statistics --- +2 packets transmitted, 2 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.260/0.297/0.334/0.037 ms + +PING f2.wg0 (192.168.2.132): 56 data bytes +64 bytes from 192.168.2.132: icmp_seq=0 ttl=64 time=0.323 ms +64 bytes from 192.168.2.132: icmp_seq=1 ttl=64 time=0.303 ms + +--- f2.wg0 ping statistics --- +2 packets transmitted, 2 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.303/0.313/0.323/0.010 ms + +PING r0.wg0 (192.168.2.120): 56 data bytes +64 bytes from 192.168.2.120: icmp_seq=0 ttl=64 time=0.716 ms +64 bytes from 192.168.2.120: icmp_seq=1 ttl=64 time=0.406 ms + +--- r0.wg0 ping statistics --- +2 packets transmitted, 2 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.406/0.561/0.716/0.155 ms + +PING r1.wg0 (192.168.2.121): 56 data bytes +64 bytes from 192.168.2.121: icmp_seq=0 ttl=64 time=0.639 ms +64 bytes from 192.168.2.121: icmp_seq=1 ttl=64 time=0.629 ms + +--- r1.wg0 ping statistics --- +2 packets transmitted, 2 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.629/0.634/0.639/0.005 ms + +PING r2.wg0 (192.168.2.122): 56 data bytes +64 bytes from 192.168.2.122: icmp_seq=0 ttl=64 time=0.569 ms +64 bytes from 192.168.2.122: icmp_seq=1 ttl=64 time=0.479 ms + +--- r2.wg0 ping statistics --- +2 packets transmitted, 2 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 0.479/0.524/0.569/0.045 ms + +PING blowfish.wg0 (192.168.2.110): 56 data bytes +64 bytes from 192.168.2.110: icmp_seq=0 ttl=255 time=35.745 ms +64 bytes from 192.168.2.110: icmp_seq=1 ttl=255 time=35.481 ms + +--- blowfish.wg0 ping statistics --- +2 packets transmitted, 2 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 35.481/35.613/35.745/0.132 ms + +PING fishfinger.wg0 (192.168.2.111): 56 data bytes +64 bytes from 192.168.2.111: icmp_seq=0 ttl=255 time=33.992 ms +64 bytes from 192.168.2.111: icmp_seq=1 ttl=255 time=33.751 ms + +--- fishfinger.wg0 ping statistics --- +2 packets transmitted, 2 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = 33.751/33.872/33.992/0.120 ms +``` + +Note that the loop above is a `tcsh` loop, the default shell used in FreeBSD. Of course, all other peers can ping their peers as well! + +After the first ping, VPN tunnels now also show handshakes and the amount of data transferred through them: + +```sh +paul@f0:~ % doas wg show +interface: wg0 + public key: Jm6YItMt94++dIeOyVi1I9AhNt2qQcryxCZezoX7X2Y= + private key: (hidden) + listening port: 56709 + +peer: 0Y/H20W8YIbF7DA1sMwMacLI8WS9yG+1/QO7m2oyllg= + preshared key: (hidden) + endpoint: 192.168.1.122:56709 + allowed ips: 192.168.2.122/32 + latest handshake: 10 seconds ago + transfer: 440 B received, 532 B sent + +peer: Hhy9kMPOOjChXV2RA5WeCGs+J0FE3rcNPDw/TLSn7i8= + preshared key: (hidden) + endpoint: 192.168.1.121:56709 + allowed ips: 192.168.2.121/32 + latest handshake: 12 seconds ago + transfer: 440 B received, 564 B sent + +peer: s3e93XoY7dPUQgLiVO4d8x/SRCFgEew+/wP7+zwgehI= + preshared key: (hidden) + endpoint: 192.168.1.120:56709 + allowed ips: 192.168.2.120/32 + latest handshake: 14 seconds ago + transfer: 440 B received, 564 B sent + +peer: SlGVsACE1wiaRoGvCR3f7AuHfRS+1jjhS+YwEJ2HvF0= + preshared key: (hidden) + endpoint: 192.168.1.132:56709 + allowed ips: 192.168.2.132/32 + latest handshake: 17 seconds ago + transfer: 472 B received, 564 B sent + +peer: Xow+d3qVXgUMk4pcRSQ6Fe+vhYBa3VDyHX/4jrGoKns= + preshared key: (hidden) + endpoint: 23.88.35.144:56709 + allowed ips: 192.168.2.110/32 + latest handshake: 55 seconds ago + transfer: 472 B received, 596 B sent + persistent keepalive: every 25 seconds + +peer: 8PvGZH1NohHpZPVJyjhctBX9xblsNvYBhpg68FsFcns= + preshared key: (hidden) + endpoint: 46.23.94.99:56709 + allowed ips: 192.168.2.111/32 + latest handshake: 55 seconds ago + transfer: 472 B received, 596 B sent + persistent keepalive: every 25 seconds + +peer: 2htXdNcxzpI2FdPDJy4T4VGtm1wpMEQu1AkQHjNY6F8= + preshared key: (hidden) + endpoint: 192.168.1.131:56709 + allowed ips: 192.168.2.131/32 +``` + +## Conclusion + +Having a mesh network on our hosts is great for securing all the traffic between them for our future `k3s` setup. A self-managed WireGuard mesh network is better than Tailscale as it eliminates reliance on a third party and provides full control over the configuration. It reduces unnecessary abstraction and "magic," enabling easier debugging and ensuring full ownership of our network. + +I look forward to the next blog post in this series. We may start setting up `k3s` or take a first look at the NFS server (for persistent storage) side of things. I hope you liked all the posts so far in this series. + +Other *BSD-related posts: + +[2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network (You are currently reading this)](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) +[2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) +[2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) +[2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) +[2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage](./2024-11-17-f3s-kubernetes-with-freebsd-part-1.md) +[2024-04-01 KISS high-availability with OpenBSD](./2024-04-01-KISS-high-availability-with-OpenBSD.md) +[2024-01-13 One reason why I love OpenBSD](./2024-01-13-one-reason-why-i-love-openbsd.md) +[2022-10-30 Installing DTail on OpenBSD](./2022-10-30-installing-dtail-on-openbsd.md) +[2022-07-30 Let's Encrypt with OpenBSD and Rex](./2022-07-30-lets-encrypt-with-openbsd-and-rex.md) +[2016-04-09 Jails and ZFS with Puppet on FreeBSD](./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.md) + +E-Mail your comments to `paul@nospam.buetow.org` + +[Back to the main site](../) diff --git a/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.md b/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.md deleted file mode 100644 index 774accd2..00000000 --- a/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.md +++ /dev/null @@ -1,79 +0,0 @@ -# f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network - -This is the fith blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines. - -I will post a new entry every month or so (there are too many other side projects for more frequent updates — I bet you can understand). - -These are all the posts so far: - -[2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage](./2024-11-17-f3s-kubernetes-with-freebsd-part-1.md) -[2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) -[2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) -[2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) - -[![f3s logo](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png "f3s logo")](./f3s-kubernetes-with-freebsd-part-1/f3slogo.png) - -> Logo was generated by ChatGPT. - -Let's begin... - -## Table of Contents - -* [⇢ f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](#f3s-kubernetes-with-freebsd---part-5-wireguard-mesh-network) -* [⇢ ⇢ Introduction](#introduction) -* [⇢ ⇢ Deciding on WireGuard](#deciding-on-wireguard) - -## Introduction - -By default, traffic within my home LAN, including traffic inside a k3s cluster, is not encrypted. While it resides in the "secure" home LAN, adopting a zero-trust policy means encryption is still preferable to ensure confidentiality and security. So we decide to secure all the traffic of all f3s participating hosts by building a mesh network of all participating hosts as shown in this graph: - -[![Full Mesh network](./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg "Full Mesh network")](./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg) - -Whereas `f0`, `f1`, and `f2` are the FreeBSD base hosts, `r0`, `r1`, and `r2` are the Rocky Linux Bhyve VMs, and `blowfish` and `fishfinger` are two OpenBSD systems running on the internet (as mentioned in the first blog of this series—these systems are already built; in fact, this very blog is served by those OpenBSD systems). - -As we can see from the graph, it is a true full-mesh network, where every host has a VPN tunnel to every other host. The benefit is that we do not need to route traffic through intermediate hosts (significantly simplifying the routing configuration). However, the downside is that there is some overhead in configuring and managing all the tunnels. - -For simplicity, we also establish VPN tunnels between `f0 <-> r0`, `f1 <-> r1`, and `f2 <-> r2`. Technically, this wouldn't be strictly required since the VMs `rN` are running on the hosts `fN`, and there is no network traffic leaving the box. However, it simplifies the configuration as we don't have to account for exceptions, and we are going to automate the mesh network configuration anyway (read on). - -## Deciding on WireGuard - -I have decided on using WireGuard as the VPN technology for this purpose. - -WireGuard is a lightweight, modern, and secure VPN protocol designed for simplicity, speed, and strong cryptography. It is an excellent choice due to its minimal codebase, ease of configuration, high performance, and robust security, utilizing state-of-the-art encryption standards. WireGuard is supported on various operating systems, and its implementations are compatible with each other. Therefore, establishing WireGuard VPN tunnels between FreeBSD, Linux, and OpenBSD is seamless. This cross-platform availability makes it suitable for setups like the one described in this blog series. - -We could have used Tailscale for an easy to setup and manage a WireGuard network, but the benefits of creating our own mesh network are: - -* Learning about WireGuard configurationd details -* Have full control over the setup -* Don't rely on an external provider like Tailscale (even if some of the components are open-source) -* Have even more fun along the way - -[https://en.wikipedia.org/wiki/WireGuard](https://en.wikipedia.org/wiki/WireGuard) -[https://www.wireguard.com/](https://www.wireguard.com/) -[https://tailscale.com/](https://tailscale.com/) - -* k3s by default traffic not encrypted - -* maybe connect other boxes off-site via wireguard vpn tunnel - -* Why not Tailscale - * I Like magic, but only when I understand it - * Learning / Curiosity (this is the 2nd whole point why I am doing this series, besides of self-hosting privacy) - * Part of OS packages - * Easier to maintain in the longer run as there are no ready to use packages for the BSDs..? - -Other *BSD-related posts: - -[2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) -[2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts](./2025-02-01-f3s-kubernetes-with-freebsd-part-3.md) -[2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation](./2024-12-03-f3s-kubernetes-with-freebsd-part-2.md) -[2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage](./2024-11-17-f3s-kubernetes-with-freebsd-part-1.md) -[2024-04-01 KISS high-availability with OpenBSD](./2024-04-01-KISS-high-availability-with-OpenBSD.md) -[2024-01-13 One reason why I love OpenBSD](./2024-01-13-one-reason-why-i-love-openbsd.md) -[2022-10-30 Installing DTail on OpenBSD](./2022-10-30-installing-dtail-on-openbsd.md) -[2022-07-30 Let's Encrypt with OpenBSD and Rex](./2022-07-30-lets-encrypt-with-openbsd-and-rex.md) -[2016-04-09 Jails and ZFS with Puppet on FreeBSD](./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.md) - -E-Mail your comments to `paul@nospam.buetow.org` - -[Back to the main site](../) diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg b/gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg new file mode 100644 index 00000000..dd1e0dd0 --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg @@ -0,0 +1,2 @@ + +wireguard diff --git a/gemfeed/index.md b/gemfeed/index.md index d276c54d..8aeffc60 100644 --- a/gemfeed/index.md +++ b/gemfeed/index.md @@ -2,6 +2,7 @@ ## To be in the .zone! +[2025-05-11 - f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-05-02 - Terminal multiplexing with `tmux` - Fish edition](./2025-05-02-terminal-multiplexing-with-tmux-fish-edition.md) [2025-04-19 - 'When: The Scientific Secrets of Perfect Timing' book notes](./2025-04-19-when-book-notes.md) [2025-04-05 - f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) diff --git a/index.md b/index.md index 2c23882b..9e3e9fa3 100644 --- a/index.md +++ b/index.md @@ -1,6 +1,6 @@ # Hello! -> This site was generated at 2025-05-05T22:21:05+03:00 by `Gemtexter` +> This site was generated at 2025-05-11T11:35:57+03:00 by `Gemtexter` Welcome to the ... @@ -38,6 +38,7 @@ Everything you read on this site is my personal opinion and experience. You can ### Posts +[2025-05-11 - f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network](./gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.md) [2025-05-02 - Terminal multiplexing with `tmux` - Fish edition](./gemfeed/2025-05-02-terminal-multiplexing-with-tmux-fish-edition.md) [2025-04-19 - 'When: The Scientific Secrets of Perfect Timing' book notes](./gemfeed/2025-04-19-when-book-notes.md) [2025-04-05 - f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs](./gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.md) diff --git a/uptime-stats.md b/uptime-stats.md index f6a17e83..3910615f 100644 --- a/uptime-stats.md +++ b/uptime-stats.md @@ -1,6 +1,6 @@ # My machine uptime stats -> This site was last updated at 2025-05-05T22:21:05+03:00 +> This site was last updated at 2025-05-11T11:35:57+03:00 The following stats were collected via `uptimed` on all of my personal computers over many years and the output was generated by `guprecords`, the global uptime records stats analyser of mine. @@ -31,11 +31,11 @@ Boots is the total number of host boots over the entire lifespan. | 8. | *uranus | 59 | | 9. | pluto | 51 | | 10. | mega15289 | 50 | -| 11. | *t450 | 43 | -| 12. | *fishfinger | 43 | -| 13. | phobos | 40 | +| 11. | *fishfinger | 43 | +| 12. | *t450 | 43 | +| 13. | *mega-m3-pro | 41 | | 14. | mega8477 | 40 | -| 15. | *mega-m3-pro | 39 | +| 15. | phobos | 40 | | 16. | *blowfish | 33 | | 17. | sun | 33 | | 18. | *f2 | 25 | @@ -56,7 +56,7 @@ Uptime is the total uptime of a host over the entire lifespan. | 2. | sun | 3 years, 9 months, 26 days | | 3. | *uranus | 3 years, 9 months, 5 days | | 4. | uugrn | 3 years, 5 months, 5 days | -| 5. | *earth | 3 years, 4 months, 24 days | +| 5. | *earth | 3 years, 4 months, 29 days | | 6. | *blowfish | 3 years, 4 months, 17 days | | 7. | deltavega | 3 years, 1 months, 21 days | | 8. | pluto | 2 years, 10 months, 29 days | @@ -69,7 +69,7 @@ Uptime is the total uptime of a host over the entire lifespan. | 15. | host0 | 1 years, 3 months, 9 days | | 16. | *makemake | 1 years, 3 months, 5 days | | 17. | tauceti-e | 1 years, 2 months, 20 days | -| 18. | *mega-m3-pro | 0 years, 11 months, 27 days | +| 18. | *mega-m3-pro | 0 years, 12 months, 7 days | | 19. | callisto | 0 years, 10 months, 31 days | | 20. | alphacentauri | 0 years, 10 months, 28 days | +-----+----------------+-----------------------------+ @@ -150,7 +150,7 @@ Lifespan is the total uptime + the total downtime of a host. | 3. | alphacentauri | 6 years, 9 months, 13 days | | 4. | vulcan | 4 years, 5 months, 6 days | | 5. | *makemake | 4 years, 4 months, 7 days | -| 6. | *earth | 3 years, 10 months, 10 days | +| 6. | *earth | 3 years, 10 months, 16 days | | 7. | sun | 3 years, 10 months, 2 days | | 8. | uugrn | 3 years, 5 months, 5 days | | 9. | *blowfish | 3 years, 4 months, 18 days | @@ -191,11 +191,11 @@ Boots is the total number of host boots over the entire lifespan. | 13. | Linux 2... | 22 | | 14. | Darwin 21... | 17 | | 15. | Darwin 15... | 15 | -| 16. | Darwin 22... | 12 | -| 17. | Darwin 18... | 11 | -| 18. | *Darwin 24... | 11 | -| 19. | FreeBSD 7... | 10 | -| 20. | FreeBSD 6... | 10 | +| 16. | *Darwin 24... | 13 | +| 17. | Darwin 22... | 12 | +| 18. | Darwin 18... | 11 | +| 19. | FreeBSD 6... | 10 | +| 20. | OpenBSD 4... | 10 | +-----+----------------+-------+ ``` @@ -211,8 +211,8 @@ Uptime is the total uptime of a host over the entire lifespan. | 2. | *OpenBSD 7... | 6 years, 7 months, 27 days | | 3. | FreeBSD 10... | 5 years, 9 months, 9 days | | 4. | Linux 5... | 4 years, 10 months, 21 days | -| 5. | Linux 4... | 2 years, 7 months, 22 days | -| 6. | *Linux 6... | 2 years, 7 months, 22 days | +| 5. | *Linux 6... | 2 years, 7 months, 27 days | +| 6. | Linux 4... | 2 years, 7 months, 22 days | | 7. | FreeBSD 11... | 2 years, 4 months, 28 days | | 8. | Linux 2... | 1 years, 11 months, 21 days | | 9. | *FreeBSD 14... | 1 years, 5 months, 2 days | @@ -225,8 +225,8 @@ Uptime is the total uptime of a host over the entire lifespan. | 16. | Darwin 22... | 0 years, 6 months, 22 days | | 17. | Darwin 15... | 0 years, 6 months, 15 days | | 18. | FreeBSD 5... | 0 years, 5 months, 18 days | -| 19. | FreeBSD 13... | 0 years, 4 months, 2 days | -| 20. | *Darwin 24... | 0 years, 3 months, 31 days | +| 19. | *Darwin 24... | 0 years, 4 months, 9 days | +| 20. | FreeBSD 13... | 0 years, 4 months, 2 days | +-----+----------------+------------------------------+ ``` @@ -242,7 +242,7 @@ Score is calculated by combining all other metrics. | 2. | *OpenBSD 7... | 424 | | 3. | FreeBSD 10... | 406 | | 4. | Linux 5... | 317 | -| 5. | *Linux 6... | 177 | +| 5. | *Linux 6... | 178 | | 6. | Linux 4... | 175 | | 7. | FreeBSD 11... | 159 | | 8. | Linux 2... | 121 | @@ -255,9 +255,9 @@ Score is calculated by combining all other metrics. | 15. | Darwin 18... | 32 | | 16. | Darwin 22... | 30 | | 17. | Darwin 15... | 29 | -| 18. | FreeBSD 5... | 25 | -| 19. | FreeBSD 13... | 25 | -| 20. | *Darwin 24... | 18 | +| 18. | FreeBSD 13... | 25 | +| 19. | FreeBSD 5... | 25 | +| 20. | *Darwin 24... | 20 | +-----+----------------+-------+ ``` @@ -271,7 +271,7 @@ Boots is the total number of host boots over the entire lifespan. +-----+------------+-------+ | 1. | *Linux | 1054 | | 2. | *FreeBSD | 944 | -| 3. | *Darwin | 144 | +| 3. | *Darwin | 146 | | 4. | *OpenBSD | 96 | | 5. | *NetBSD | 1 | +-----+------------+-------+ @@ -285,10 +285,10 @@ Uptime is the total uptime of a host over the entire lifespan. +-----+------------+-----------------------------+ | Pos | KernelName | Uptime | +-----+------------+-----------------------------+ -| 1. | *Linux | 27 years, 8 months, 13 days | +| 1. | *Linux | 27 years, 8 months, 19 days | | 2. | *FreeBSD | 11 years, 4 months, 3 days | | 3. | *OpenBSD | 7 years, 3 months, 8 days | -| 4. | *Darwin | 4 years, 7 months, 19 days | +| 4. | *Darwin | 4 years, 7 months, 28 days | | 5. | *NetBSD | 0 years, 1 months, 1 days | +-----+------------+-----------------------------+ ``` @@ -301,10 +301,10 @@ Score is calculated by combining all other metrics. +-----+------------+-------+ | Pos | KernelName | Score | +-----+------------+-------+ -| 1. | *Linux | 1836 | +| 1. | *Linux | 1837 | | 2. | *FreeBSD | 794 | | 3. | *OpenBSD | 464 | -| 4. | *Darwin | 301 | +| 4. | *Darwin | 303 | | 5. | *NetBSD | 2 | +-----+------------+-------+ ``` -- cgit v1.2.3