Skip to content

Multi-cloud Kubernetes infrastructure with CAPI, encrypted volumes and comprehensive deployment automation + nix

Notifications You must be signed in to change notification settings

blind3dd/multi-cloud-k8s-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Multi-Cloud Kubernetes Local

A comprehensive local infrastructure setup for deploying multi-cloud Kubernetes clusters using Nix package manager, encrypted volumes, and proxy-based networking.

πŸ—οΈ Architecture Overview

This project creates a multi-cloud Kubernetes infrastructure with:

  • 13 Encrypted Volumes representing different cloud providers
  • Provider-Grouped Networking with logical IP allocation
  • Container Runtime (containerd + crictl) configured for all volumes
  • CAPI Orchestration for multi-cloud cluster management
  • Cross-Cloud Networking with Cilium, Istio, and WireGuard
  • πŸ”„ Proxy-Based Communication for reliable volume connectivity (KEY FEATURE)

🌐 Proxy-Based Networking (Core Feature)

The proxy-based networking is the key innovation that makes this setup work reliably on macOS:

Simple HTTP Proxy Server

  • Main Proxy: http://localhost:8000
  • Status Endpoint: http://localhost:8000/status
  • Health Check: http://localhost:8000/health
  • Volume Access: http://localhost:8000/volume/{volume_name}

Communication Flow

Volume A β†’ Simple Proxy (8000) β†’ Volume B
Volume A β†’ Simple Proxy (8000) β†’ Localhost Services
Volume A (AWS) β†’ Simple Proxy (8000) β†’ Volume B (Azure)

Why Proxy-Based?

  • Reliable: HTTP-based communication that works across platforms
  • Simple: Single proxy server for all communication
  • Debuggable: Easy to test with curl commands
  • Cross-Platform: Works on macOS, Linux, and other platforms
  • Manageable: Centralized proxy management

πŸ“ Project Structure

multi-cloud-k8s-local/
β”œβ”€β”€ README.md                           # This file
β”œβ”€β”€ QUICK_START.md                      # Quick start guide
β”œβ”€β”€ setup-main.sh                       # πŸš€ MAIN SETUP SCRIPT (ONE COMMAND)
β”œβ”€β”€ MULTI_CLOUD_K8S_SETUP_SUMMARY.md   # Detailed setup summary
β”œβ”€β”€ create-volumes-simple.sh           # Create encrypted volumes
β”œβ”€β”€ configure-volumes.sh               # Configure volumes with Nix
β”œβ”€β”€ setup-provider-networking.sh       # Provider-grouped networking
β”œβ”€β”€ setup-cross-cloud-networking.sh    # Cross-cloud networking stack
β”œβ”€β”€ setup-container-runtime.sh         # Container runtime setup
β”œβ”€β”€ setup-macos-networking.sh          # macOS networking (ifconfig/pfctl)
β”œβ”€β”€ setup-simple-proxy.sh              # πŸ”„ PROXY-BASED NETWORKING
β”œβ”€β”€ deploy-capi-simple.sh              # CAPI deployment
└── volumes/                           # Encrypted volume configurations
    β”œβ”€β”€ etcd-1/                        # AWS etcd node
    β”œβ”€β”€ etcd-2/                        # Azure etcd node
    β”œβ”€β”€ etcd-3/                        # GCP etcd node
    β”œβ”€β”€ talos-control-plane-1/         # AWS control plane
    β”œβ”€β”€ talos-control-plane-2/         # Azure control plane
    β”œβ”€β”€ talos-control-plane-3/         # GCP control plane
    β”œβ”€β”€ talos-control-plane-4/         # IBM control plane
    β”œβ”€β”€ talos-control-plane-5/         # DigitalOcean control plane
    β”œβ”€β”€ karpenter-worker-1/            # AWS worker
    β”œβ”€β”€ karpenter-worker-2/            # Azure worker
    β”œβ”€β”€ karpenter-worker-3/            # GCP worker
    β”œβ”€β”€ karpenter-worker-4/            # IBM worker
    β”œβ”€β”€ karpenter-worker-5/            # DigitalOcean worker
    β”œβ”€β”€ capi-management/               # CAPI configurations
    └── networking/                    # Networking configurations
        └── proxy/                     # πŸ”„ PROXY-BASED NETWORKING
            β”œβ”€β”€ simple-proxy.py        # Main proxy server
            β”œβ”€β”€ manage-simple-proxy.sh # Proxy management
            └── simple-proxy-architecture.md

πŸš€ Quick Start

One-Command Setup

For the complete setup, run:

./setup-main.sh

This single command orchestrates the entire infrastructure setup with detailed step descriptions.

Manual Setup (Alternative)

If you prefer to run individual components:

Prerequisites

  • macOS (tested on macOS 14.6.0)
  • Nix package manager installed
  • Root/sudo access for network operations
  • Python 3 for proxy server

1. Create Encrypted Volumes

sudo ./create-volumes-simple.sh

This creates 13 encrypted volumes representing different cloud providers.

2. Configure Volumes

sudo ./configure-volumes.sh

This configures each volume with Nix and Kubernetes tools.

3. πŸ”„ Setup Proxy-Based Networking (KEY STEP)

sudo ./setup-simple-proxy.sh
sudo ./volumes/networking/proxy/manage-simple-proxy.sh start

This sets up the proxy server for volume communication.

4. Deploy CAPI

sudo ./deploy-capi-simple.sh

This sets up Cluster API for multi-cloud orchestration.

πŸ”§ Management Commands

πŸ”„ Proxy Management (Primary)

# Start/stop proxy server
sudo ./volumes/networking/proxy/manage-simple-proxy.sh start
sudo ./volumes/networking/proxy/manage-simple-proxy.sh stop

# Check proxy status
sudo ./volumes/networking/proxy/manage-simple-proxy.sh status

# Test connectivity
sudo ./volumes/networking/proxy/manage-simple-proxy.sh test

# Test specific volume
curl http://localhost:8000/volume/etcd-1
curl http://localhost:8000/status

Volume Management

# Mount/unmount all volumes
sudo ./volumes/manage-volumes.sh mount-all
sudo ./volumes/manage-volumes.sh unmount-all

# Check volume status
sudo ./volumes/manage-volumes.sh status

Container Runtime Management

# Check container runtime status
sudo ./volumes/manage-container-runtime.sh status

# Install container runtime in volumes
sudo ./volumes/manage-container-runtime.sh install

CAPI Management

# Initialize CAPI
sudo ./volumes/capi-management/manage-capi.sh init

# Deploy clusters
sudo ./volumes/capi-management/manage-capi.sh deploy

# Check CAPI status
sudo ./volumes/capi-management/manage-capi.sh status

🌐 Network Architecture

Provider Networks

  • AWS Provider: 10.0.0.0/16 (etcd-1, talos-control-plane-1, karpenter-worker-1)
  • Azure Provider: 10.1.0.0/16 (etcd-2, talos-control-plane-2, karpenter-worker-2)
  • GCP Provider: 10.2.0.0/16 (etcd-3, talos-control-plane-3, karpenter-worker-3)
  • IBM Provider: 10.3.0.0/16 (talos-control-plane-4, karpenter-worker-4)
  • DigitalOcean Provider: 10.4.0.0/16 (talos-control-plane-5, karpenter-worker-5)

πŸ”„ Proxy Communication (Core)

πŸ”’ Security Features

  • AES-256 Encrypted Volumes with predictable passphrases
  • Provider-Grouped Networking for logical isolation
  • Container Runtime Security with containerd and crictl
  • Cross-Cloud Encryption with WireGuard VPN
  • Network Policies with Cilium CNI
  • mTLS Communication with Istio service mesh
  • πŸ”„ Proxy-Based Security with centralized access control

πŸ“Š Current Status

Component Status Progress
Nix Configuration βœ… Complete 100%
Encrypted Volumes βœ… Complete 100%
Provider Networking βœ… Complete 100%
Container Runtime βœ… Complete 100%
CAPI Setup βœ… Complete 100%
Cross-Cloud Networking βœ… Complete 100%
πŸ”„ Proxy Networking βœ… Complete 100%
Cluster Deployment πŸ”„ Pending 0%
Connectivity Testing πŸ”„ Pending 0%

πŸ› οΈ Tools Installed

Kubernetes Tools

  • kubectl: v1.33.4
  • clusterctl: v1.11.0
  • helm: v3.18.6
  • talosctl: v1.10.7

Container Runtime

  • containerd: v2.1.4
  • runc: v1.3.0
  • crictl: v1.32.0
  • CNI plugins: v1.4.1

πŸ”„ Proxy Server

  • Python 3 HTTP Server: Custom proxy implementation
  • Port 8000: Main proxy endpoint
  • Volume Endpoints: Individual volume access

πŸ”„ Next Steps

  1. Deploy Multi-Cloud Kubernetes Clusters - Initialize CAPI and deploy clusters
  2. Test Cross-Cloud Connectivity - Verify networking and cluster communication via proxy
  3. Deploy Applications - Deploy sample applications across providers
  4. Monitor and Scale - Set up monitoring and auto-scaling

πŸ“š Documentation

🀝 Contributing

This is a proof-of-concept implementation for multi-cloud Kubernetes infrastructure with proxy-based networking as the key innovation. Contributions and improvements are welcome!

πŸ“„ License

This project is part of the database_CI repository and follows the same licensing terms.


Total Setup Time: ~3 hours
Files Created: 50+ configuration and management files
Volumes Configured: 13 encrypted volumes
Cloud Providers: 5 (AWS, Azure, GCP, IBM, DigitalOcean)
Management Scripts: 8 comprehensive automation scripts
πŸ”„ Proxy Server: HTTP-based communication for all volumes

About

Multi-cloud Kubernetes infrastructure with CAPI, encrypted volumes and comprehensive deployment automation + nix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published