- Create README.md for Immich app description - Add example.env for configuration settings - Implement deployment.yaml for Immich server and microservices - Set up ingress.yaml for public access with DNS annotations - Introduce db-init-job.yaml for database initialization - Configure kustomization.yaml for resource management - Define manifest.yaml for Immich app installation details - Create namespace.yaml for isolating Immich resources - Establish PVCs in pvc.yaml for storage management - Set up services in service.yaml for server and machine learning components - Update CoreDNS custom config to handle AAAA records
Infrastructure setup scripts
Creates a fully functional personal cloud infrastructure on a bare metal Kubernetes (k3s) cluster that provides:
- External access to services via configured domain names (using ${DOMAIN})
- Internal-only access to admin interfaces (via internal.${DOMAIN} subdomains)
- Secure traffic routing with automatic TLS
- Reliable networking with proper load balancing
Architecture
Internet → External DNS → MetalLB LoadBalancer → Traefik → Kubernetes Services
↑
Internal DNS
↑
Internal Network
Key Components
- MetalLB - Provides load balancing for bare metal clusters
- Traefik - Handles ingress traffic, TLS termination, and routing
- cert-manager - Manages TLS certificates
- CoreDNS - Provides DNS resolution for services
- Kubernetes Dashboard - Web UI for cluster management (accessible via https://dashboard.internal.${DOMAIN})
Configuration Approach
All infrastructure components use a consistent configuration approach:
- Environment Variables - All configuration settings are managed using environment variables loaded by running
source load-env.sh
- Template Files - Configuration files use templates with
${VARIABLE}
syntax - Setup Scripts - Each component has a dedicated script in
infrastructure_setup/
for installation and configuration
Idempotent Design
All setup scripts are designed to be idempotent:
- Scripts can be run multiple times without causing harm
- Each script checks for existing resources before creating new ones
- Configuration updates are applied cleanly without duplication
- Failed or interrupted setups can be safely retried
- Changes to configuration will be properly applied on subsequent runs
This idempotent approach ensures consistent, reliable infrastructure setup and allows for incremental changes without requiring a complete teardown and rebuild.