Skip to content

fullstackjam/k8s-gitops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

908 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

k8s-gitops

License: GPL v3 Documentation Status

A comprehensive, production-ready Kubernetes homelab infrastructure built with Infrastructure as Code (IaC) and GitOps practices. This repository provides a complete solution for deploying and managing a self-hosted Kubernetes cluster with modern DevOps tools and best practices.

πŸš€ Features

Core Infrastructure

  • Automated Bare Metal Provisioning: PXE-based installation of Fedora Server across multiple nodes
  • Kubernetes Cluster: Deployed using kubespray for production-grade configuration
  • GitOps Workflow: ArgoCD for continuous deployment and configuration management
  • Infrastructure as Code: Everything defined declaratively with Ansible, Terraform, and Kubernetes manifests

Platform Services

  • Container Registry: Private container registry with Harbor
  • CI/CD Pipeline: Woodpecker CI for automated builds and deployments
  • Git Repository: Self-hosted Gitea for source code management
  • Identity Management: Kanidm for authentication and authorization
  • Monitoring Stack: Grafana, Prometheus, and Loki for observability
  • Certificate Management: Automated SSL/TLS certificates with cert-manager and Let's Encrypt

Storage & Networking

  • Distributed Storage: Rook Ceph for reliable block and object storage
  • Load Balancing: NGINX Ingress Controller for traffic routing
  • DNS Management: External DNS integration with Cloudflare
  • Secure Tunneling: Cloudflare Tunnel for secure external access

External Access

  • Terraform Automation: Automated setup of external access infrastructure
  • Cloudflare Integration: DNS management, tunnel configuration, and SSL certificates
  • Monitoring Alerts: ntfy integration for system notifications

Security & Backup

  • Secret Management: External Secrets Operator with encrypted storage
  • Network Policies: Cilium for network security and observability
  • Automated Updates: Renovate for dependency management
  • Backup Solutions: Automated backup strategies for data protection

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Hardware Layer                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚ Node 1  β”‚  β”‚ Node 2  β”‚  β”‚ Node 3  β”‚  β”‚ Node N  β”‚        β”‚
β”‚  β”‚(Master) β”‚  β”‚(Worker) β”‚  β”‚(Worker) β”‚  β”‚(Worker) β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 Infrastructure Layer                        β”‚
β”‚  Fedora Server + kubespray + Kubernetes + Rook Ceph        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Platform Services                         β”‚
β”‚  ArgoCD β”‚ Gitea β”‚ Woodpecker β”‚ Harbor β”‚ Kanidm β”‚ Grafana    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Application Layer                          β”‚
β”‚  Homepage β”‚ Jellyfin β”‚ Matrix β”‚ Paperless β”‚ Custom Apps     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“š Documentation

Comprehensive documentation is available at k8s-gitops.fullstackjam.com, including:

πŸš€ Production Deployment

For production deployment, see the Production Installation Guide.

πŸ› οΈ Tech Stack

Infrastructure

  • Operating System: Fedora Server
  • Container Orchestration: Kubernetes (deployed with kubespray)
  • Infrastructure Automation: Ansible
  • External Access Setup: Terraform (Cloudflare Tunnel, DNS, certificates)
  • GitOps: ArgoCD

Storage & Networking

  • Storage: Rook Ceph
  • Load Balancer: NGINX Ingress Controller
  • Network Security: Cilium CNI
  • DNS: External DNS + Cloudflare
  • Tunneling: Cloudflare Tunnel

Platform Services

  • Version Control: Gitea
  • CI/CD: Woodpecker CI
  • Container Registry: Harbor
  • Identity Management: Kanidm
  • Monitoring: Grafana + Prometheus + Loki
  • Certificate Management: cert-manager + Let's Encrypt

Development Tools

  • Secret Management: External Secrets Operator
  • Dependency Updates: Renovate
  • Documentation: MkDocs Material
  • Configuration Management: Helm Charts

πŸ“ Repository Structure

k8s-gitops/
β”œβ”€β”€ docs/                    # Documentation
β”‚   β”œβ”€β”€ concepts/           # Core concepts and explanations
β”‚   β”œβ”€β”€ how-to-guides/     # Step-by-step guides
β”‚   β”œβ”€β”€ installation/      # Installation instructions
β”‚   └── reference/         # Technical reference
β”œβ”€β”€ kubernetes/            # Kubernetes manifests
β”‚   β”œβ”€β”€ apps/             # Application deployments
β”‚   β”œβ”€β”€ platform/         # Platform services
β”‚   └── system/           # System components
β”œβ”€β”€ metal/                 # Bare metal provisioning (Ansible)
β”‚   └── kubespray/        # Kubernetes deployment with [kubespray](https://github.com/fullstackjam/kubespray) (submodule)
β”œβ”€β”€ external/             # External access setup with Terraform
β”œβ”€β”€ scripts/              # Utility scripts
└── test/                 # Integration tests

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch from upstream/master
  3. Make your changes
  4. Test your changes locally
  5. Submit a pull request

πŸ“‹ Status

Current Status: Alpha

This project is currently in alpha phase. While functional, it's primarily designed for learning and experimentation. See our Roadmap for planned features and stability improvements.

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Important: By using this project, you agree to:

  • Use the same GPL v3 license for any derived works
  • Keep your project open-source
  • Include proper attribution

πŸ™ Acknowledgments

  • Inspired by khuedoan/homelab
  • Built with modern DevOps tools and practices
  • Community contributions and feedback

⭐ If you find this project helpful, please give it a star!