provisioning/docs/src/guides/from-scratch.md

1 line
27 KiB
Markdown
Raw Normal View History

# Complete Deployment Guide: From Scratch to Production\n\n**Version**: 3.5.0\n**Last Updated**: 2025-10-09\n**Estimated Time**: 30-60 minutes\n**Difficulty**: Beginner to Intermediate\n\n---\n\n## Table of Contents\n\n1. [Prerequisites](#prerequisites)\n2. [Step 1: Install Nushell](#step-1-install-nushell)\n3. [Step 2: Install Nushell Plugins (Recommended)](#step-2-install-nushell-plugins-recommended)\n4. [Step 3: Install Required Tools](#step-3-install-required-tools)\n5. [Step 4: Clone and Setup Project](#step-4-clone-and-setup-project)\n6. [Step 5: Initialize Workspace](#step-5-initialize-workspace)\n7. [Step 6: Configure Environment](#step-6-configure-environment)\n8. [Step 7: Discover and Load Modules](#step-7-discover-and-load-modules)\n9. [Step 8: Validate Configuration](#step-8-validate-configuration)\n10. [Step 9: Deploy Servers](#step-9-deploy-servers)\n11. [Step 10: Install Task Services](#step-10-install-task-services)\n12. [Step 11: Create Clusters](#step-11-create-clusters)\n13. [Step 12: Verify Deployment](#step-12-verify-deployment)\n14. [Step 13: Post-Deployment](#step-13-post-deployment)\n15. [Troubleshooting](#troubleshooting)\n16. [Next Steps](#next-steps)\n\n---\n\n## Prerequisites\n\nBefore starting, ensure you have:\n\n- ✅ **Operating System**: macOS, Linux, or Windows (WSL2 recommended)\n- ✅ **Administrator Access**: Ability to install software and configure system\n- ✅ **Internet Connection**: For downloading dependencies and accessing cloud providers\n- ✅ **Cloud Provider Credentials**: UpCloud, Hetzner, AWS, or local development environment\n- ✅ **Basic Terminal Knowledge**: Comfortable running shell commands\n- ✅ **Text Editor**: vim, nano, Zed, VSCode, or your preferred editor\n\n### Recommended Hardware\n\n- **CPU**: 2+ cores\n- **RAM**: 8 GB minimum, 16 GB recommended\n- **Disk**: 20 GB free space minimum\n\n---\n\n## Step 1: Install Nushell\n\nNushell 0.109.1+ is the primary shell and scripting language for the provisioning platform.\n\n### macOS (via Homebrew)\n\n```\n# Install Nushell\nbrew install nushell\n\n# Verify installation\nnu --version\n# Expected: 0.109.1 or higher\n```\n\n### Linux (via Package Manager)\n\n**Ubuntu/Debian:**\n\n```\n# Add Nushell repository\ncurl -fsSL https://starship.rs/install.sh | bash\n\n# Install Nushell\nsudo apt update\nsudo apt install nushell\n\n# Verify installation\nnu --version\n```\n\n**Fedora:**\n\n```\nsudo dnf install nushell\nnu --version\n```\n\n**Arch Linux:**\n\n```\nsudo pacman -S nushell\nnu --version\n```\n\n### Linux/macOS (via Cargo)\n\n```\n# Install Rust (if not already installed)\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource $HOME/.cargo/env\n\n# Install Nushell\ncargo install nu --locked\n\n# Verify installation\nnu --version\n```\n\n### Windows (via Winget)\n\n```\n# Install Nushell\nwinget install nushell\n\n# Verify installation\nnu --version\n```\n\n### Configure Nushell\n\n```\n# Start Nushell\nnu\n\n# Configure (creates default config if not exists)\nconfig nu\n```\n\n---\n\n## Step 2: Install Nushell Plugins (Recommended)\n\nNative plugins provide **10-50x performance improvement** for authentication, KMS, and orchestrator operations.\n\n### Why Install Plugins\n\n**Performance Gains:**\n\n- 🚀 **KMS operations**: ~5 ms vs ~50 ms (10x faster)\n- 🚀 **Orchestrator queries**: ~1 ms vs ~30 ms (30x faster)\n- 🚀 **Batch encryption**: 100 files in 0.5s vs 5s (10x faster)\n\n**Benefits:**\n\n- ✅ Native Nushell integration (pipelines, data structures)\n- ✅ OS keyring for secure token storage\n- ✅ Offline capability (Age encryption, local orchestrator)\n- ✅ Graceful fallback to HTTP if not installed\n\n### Prerequisites for Building Plugins\n\n```\n# Install Rust toolchain (if not already installed)\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource $HOME/.cargo/env\nrustc --version\n# Expected: rustc 1.75+ or higher\n\n# Linux only: Install development packages\nsudo apt install libssl-dev pkg-config # Ubuntu/Debian\nsudo dnf install openssl-devel