Skip to content

Latest commit

 

History

History
251 lines (194 loc) · 8.44 KB

File metadata and controls

251 lines (194 loc) · 8.44 KB

HomeLab Infrastructure Portfolio

License Terraform Kubernetes Pre-commit

Welcome to my HomeLab infrastructure repository! This repository showcases my personal homelab setup, infrastructure automation, and technical capabilities.

🏠 Overview

This repository contains documentation, diagrams, and code for my homelab environment. It demonstrates my skills in:

  • Network design and architecture
  • Infrastructure as Code (IaC) using Terraform
  • Configuration management with Ansible
  • Kubernetes cluster deployment and orchestration
  • Cloud-init automated provisioning
  • Automation and scripting
  • System administration and DevOps practices

📰 Recent Changes

Kubernetes Cluster Deployment (v0.1)

The latest updates include a full Kubernetes cluster deployment using Terraform and cloud-init:

  • Kubernetes v1.29 cluster with one master and two worker nodes
  • Containerd as the container runtime (following Kubernetes 1.24+ best practices)
  • Calico CNI for pod networking
  • Automated provisioning via cloud-init configuration
  • Terraform modules for VM deployment on Proxmox
  • CI/CD workflows for infrastructure validation

📁 Repository Structure

HomeLab/
├── .github/
│   ├── workflows/               # GitHub Actions CI/CD pipelines
│   └── ISSUE_TEMPLATE/          # Issue templates for bug reports and features
├── docs/                        # Documentation and guides
│   ├── overview.md              # Architecture overview
│   ├── runbook.md               # Deployment and operations guide
│   ├── network-setup.md         # Network configuration
│   ├── service-deployment.md    # Service deployment guides
│   ├── backup-strategy.md       # Backup procedures
│   └── security.md              # Security guidelines
├── diagrams/                    # Network and infrastructure diagrams
│   ├── network/                 # Network topology diagrams
│   └── infrastructure/          # Infrastructure architecture diagrams
├── terraform/                   # Infrastructure as Code (Terraform)
│   ├── deployments/             # Deployment configurations
│   │   └── home-lab/            # Home lab deployment (K8s cluster)
│   └── modules/                 # Reusable Terraform modules
│       └── compute/             # Compute resource modules
│           └── pve-cloudinit-vm/  # Proxmox cloud-init VM module
├── ansible/                     # Configuration management
│   ├── playbooks/               # Ansible playbooks
│   ├── roles/                   # Custom roles
│   └── inventory/               # Inventory files
└── scripts/                     # Utility scripts and automation
    ├── backup/                  # Backup scripts
    ├── monitoring/              # Monitoring scripts
    └── deployment/              # Deployment automation
        └── cloud-init/          # Cloud-init configurations for K8s

🔧 Technologies Used

  • Virtualization: Proxmox, Docker, Kubernetes
  • Infrastructure as Code: Terraform
  • Configuration Management: Ansible
  • Networking: VLANs, OpnSense, UniFi
  • Monitoring: Prometheus, Grafana
  • Storage: NAS, ZFS
  • Scripting: Bash, Python

🚀 Getting Started

Prerequisites

  • Terraform >= 1.14
  • Ansible >= 2.9
  • Python >= 3.8
  • Proxmox VE (for infrastructure deployment)
  • kubectl (for Kubernetes cluster management)
  • Docker (optional, for local testing)

Quick Start

  1. Clone this repository:

    git clone https://github.com/krakenhavoc/HomeLab.git
    cd HomeLab
  2. Review the documentation:

  3. Deploy Kubernetes cluster:

    # Navigate to terraform deployment
    cd terraform/deployments/home-lab
    
    # Initialize Terraform
    terraform init
    
    # Review planned changes
    terraform plan
    
    # Apply configuration
    terraform apply
  4. Access your cluster:

    # SSH to master node
    ssh root@k8s-master-1
    
    # Check cluster status
    kubectl get nodes
    kubectl get pods -A

Docker Example

For local testing and development:

# Run containerized applications
docker run -d -p 8080:80 nginx

Kubernetes Example

Deploy an application to your cluster:

# Create a deployment
kubectl create deployment nginx --image=nginx

# Expose the deployment
kubectl expose deployment nginx --port=80 --type=NodePort

# Check the service
kubectl get services

📊 Infrastructure Components

Network Infrastructure

  • Core network topology with VLAN segmentation
  • Firewall rules and security policies (OpnSense)
  • DNS and DHCP configuration
  • UniFi network management

Compute Resources

  • Proxmox VE hypervisor for virtualization
  • Kubernetes cluster (1 master + 2 worker nodes)
    • Containerd runtime
    • Calico CNI networking
    • Cloud-init automated provisioning
  • Virtual machine templates and configurations
  • Resource allocation and auto-scaling

Services

  • Kubernetes workloads (microservices, applications)
  • Media servers (Plex, Jellyfin)
  • Development environments
  • Monitoring stack (Prometheus, Grafana)
  • Logging and observability
  • Backup and disaster recovery solutions

📖 Documentation

Detailed documentation for each component can be found in the docs/ directory:

🌐 Supported Platforms

  • Hypervisor: Proxmox VE 7.x+
  • Operating Systems: Ubuntu 22.04 LTS (cloud-init images)
  • Container Runtime: Containerd 1.6+
  • Kubernetes: v1.29
  • Terraform: 1.0+
  • Ansible: 2.9+

💻 Language Composition

  • HCL (Terraform) - Infrastructure as Code
  • YAML - Cloud-init configurations, Kubernetes manifests, Ansible playbooks
  • Bash - Automation scripts
  • Python - Utility scripts and tooling
  • Markdown - Documentation

🔐 Security & Best Practices

  • Secrets are managed using environment variables and secure vaults
  • No sensitive credentials are stored in this repository
  • Infrastructure follows the principle of least privilege
  • Regular security updates and patch management

📈 Future Enhancements

  • Implement GitOps workflows (ArgoCD/Flux)
  • Expand CI/CD pipelines for automated testing
  • Add Helm charts for application deployments
  • Enhance monitoring with custom dashboards
  • Implement log aggregation (ELK/Loki)
  • Automated disaster recovery procedures
  • Service mesh integration (Istio/Linkerd)

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Code of conduct
  • Development workflow
  • Pull request process
  • Code style guidelines

To report bugs or request features, please use our issue templates.

📋 Changelog

See CHANGELOG.md for a detailed history of changes and releases.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

This project is for portfolio and educational purposes.

👤 Maintainer

krakenhavoc

📧 Contact

For questions, suggestions, or collaboration opportunities:


Star this repository if you find it helpful or interesting!

This repository is actively maintained and regularly updated with new features and improvements.