xNok/infra-bootstrap-tools
About
IaC configurations to bootstrap and manage a small self-hosted project or homelab
Systems & InfrastructureMeasured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalInfra-Bootstrap-Tools (IBT)
Production-grade Infrastructure as Code for homelabs, edge nodes, and self-hosted clouds — from minimalist Docker Swarm to Zero-Trust Kubernetes GitOps.
🎯 Reusable Deliverables & Artifacts
Infra-Bootstrap-Tools produces concrete, production-ready deliverables that you can consume directly in your own infrastructure:
| Deliverable | Description | Location / Install Command |
|---|---|---|
| 🌐 Documentation Website | Full architecture guides, interactive runbooks, and diagrams | xnok.github.io/infra-bootstrap-tools |
| 📦 Ansible Galaxy Collection | Battle-tested roles for Docker, Swarm, K3s, UFW hardening, and Flux | ansible-galaxy collection install xnok.infra_bootstrap_tools |
| 🚢 OCI GitOps Fleet Artifacts | Versioned Flux D2 manifests & platform add-ons on GitHub Packages | oci://ghcr.io/xnok/infra-bootstrap-tools/manifests/... |
| 🐳 Production Compose Stacks | Caddy (automated Let's Encrypt + OAuth portal), Portainer CE, Rclone | stacks/ |
| 🧪 Local Test Harness | Zero-cost Kind + local OCI registry integration test environment | make k3s-test (bin/tests/flux-d2/test.sh) |
🏛️ Architecture: The Dual-Orchestration Model
Infrastructure is not one-size-fits-all. A simple personal homelab does not warrant the overhead of an enterprise control plane. Conversely, complex multi-service architectures demand declarative GitOps, fine-grained RBAC, and zero-trust perimeter isolation.
infra-bootstrap-tools maintains strict architectural parity across two distinct orchestration tracks:

Choosing Your Track
| Concern | Docker Swarm Track (Pragmatic Homelab) | Kubernetes Track (Dark K3s & GitOps) |
|---|---|---|
| Design Philosophy | Minimalist, single-binary, low operational overhead | Enterprise GitOps & Zero-Trust defense-in-depth |
| Control Plane | Docker Swarm internal Raft manager | K3s server bound strictly to 127.0.0.1 |
| Perimeter & Ingress | Caddy: Open ports 80/443, automated Let's Encrypt TLS | OpenZiti: Zero public ports; API is completely dark |
| Workload Definition | Docker Compose / Stack files (deploy: stanza) |
Kustomize Components & HelmReleases via Flux |
| Cluster Operations | Portainer: Graphical web management dashboard | FluxCD Operator: Branchless OCI GitOps reconciliation |
| Recommended For | Low-spec hardware, utility containers, rapid homelabs | Production homelabs, GitOps workflows, zero-trust edge |
🚀 10-Minute Quickstart
1. Enter the Hermetic Nix Environment
Avoid tool version conflicts by entering our pre-configured Nix development shell:
# For Ansible & Swarm deployment:
nix develop .#ansible
# For Kubernetes, Flux, and Kind testing:
nix develop .#flux
# Full unified environment:
nix develop .#full
(If you use direnv, run direnv allow once to load dependencies automatically on directory entry).
2. Configure Credentials
Generate template secrets or connect via 1Password CLI:
./bin/bash/setup-secrets.sh
3. Deploy Your Chosen Track
# Track A: Deploy Docker Swarm on Cloud VMs (DigitalOcean / AWS)
make swarm-up
# Track B1: Run Zero-Cost Local Kubernetes Validation (Kind + Local Registry)
make k3s-test
# Track B2: Deploy Dark K3s on Cloud VMs
make k3s-up
# Teardown Cloud Infrastructure
make down
For the complete step-by-step walkthrough, see the Getting Started Runbook.
🛠️ Using & Contributing to This Monorepo Layout
If you are using this repository as a template for your own infrastructure or contributing changes, the monorepo is organized into clear functional layers:
Monorepo Directory Layout
.
├── ansible/ # Ansible Collection: xnok.infra_bootstrap_tools
│ ├── playbooks/ # Orchestrator entrypoints (main.yml, k3s.yml, docker-swarm.yml)
│ └── roles/ # Modular roles (docker, k3s_server, k3s_os_hardening, etc.)
├── kubernetes/ # Enterprise Flux D2 GitOps Layout
│ ├── fleet/ # Per-cluster manifests & values (k3s, kind)
│ └── infra-addons/ # Opt-in Kustomize components (cert-manager, openziti, keycloak)
├── terraform/ # Cloud VM and networking provisioning (DigitalOcean, AWS)
├── stacks/ # Docker Swarm Compose application stacks
├── website/ # Hugo documentation source (published to GitHub Pages)
└── docs/ # PARA Docs-as-Code knowledge management & active project notes
Development Standards & Quality Gates
- Hermetic Toolchains: Managed via Nix Flakes in
flake.nix. - Pre-commit Automation: Enforces yamllint, shellcheck, and ansible-lint before commits (
.pre-commit-config.yaml). - Release Automation via Changesets:
Every change that modifies packages creates an intentional changelog entry:
GitHub Actions automatically versions packages, updates changelogs, tags releases, and publishes the Ansible Collection to Ansible Galaxy.npx changeset add - Docs-as-Code (PARA Method):
Active tasks and architectural decisions are captured in
docs/1-projects/before code is committed, ensuring zero hidden knowledge.
📚 DevOps & Cloud Infrastructure Learning Plan
This repository acts as an interactive curriculum for learning modern infrastructure engineering, pairing hands-on code with in-depth technical writeups:
Level 1: Foundations (DevOps 101)
- 🏭 Provisioning VMs on DigitalOcean with Terraform: Declarative cloud compute and networking.
- 🔏 Creating SSH Keys & GitHub Environments with Terraform: Cryptographic state management and secret isolation.
- 🗺️ Generating Ansible Inventory from Terraform: Bridging infrastructure provisioning and configuration management.
- 👩 Running Ansible Playbooks via GitHub Actions: Automated CI/CD execution patterns.
Level 2: Docker Swarm & Edge Ingress
- 🧰 Disposable Local Test Environments with Vagrant: Safe pre-flight playbook testing (Companion Code).
- 🐳 Multi-Node Clustering on Docker Swarm with Ansible: Raft quorums and overlay networks (Companion Code).
- 🏃♂️ Zero-Downtime Docker Secret Rotation with Ansible: Rolling container updates without secrets leaking to disk.
- 🔒 Automated SSL & Ingress with Caddy: Reverse proxying, automated certificates, and OAuth portals.
- 📊 Cluster Operations with Portainer: Visual management dashboards and container metrics.
Level 3: Zero-Trust Kubernetes & Enterprise GitOps
- 🛡️ Host Hardening & UFW Default-Deny Policies: Defense-in-depth, CNI isolation, and port lockdown.
- 🌑 Hiding the Kubernetes API Server Behind OpenZiti: Why port 6443 should never be public, and how overlay networks eliminate port-scanning vulnerabilities.
- 🔄 Enterprise GitOps with Flux D2 & OCI: Gitless monorepo syncing, values layering rules, and immediate ConfigMap watch reconciliation.
- 🧪 Reproducing Production Locally with Kind: Local OCI artifact pushes and deep validation assertions without cloud bills.
- ⚡ Safe IaC: Pull-Request Locking for Ansible & Speeding up Playbooks by Running Affected Roles: Concurrency guards and selective execution in CI.
🤝 Contributing & Community
Contributions, issue reports, and feature proposals are welcome!
- Check open issues or create a project note in
docs/1-projects/. - Enter the development shell (
nix develop). - Create a changeset for your contribution (
npx changeset add). - Submit a Pull Request against
main.
Explore the complete documentation site at https://xnok.github.io/infra-bootstrap-tools/.
Explore related projects
Loading…