2026-01-14 02:59:52 +00:00
|
|
|
# Update Existing Infrastructure\n\n**Goal**: Safely update running infrastructure with minimal downtime\n**Time**: 15-30 minutes\n**Difficulty**: Intermediate\n\n## Overview\n\nThis guide covers:\n\n1. Checking for updates\n2. Planning update strategies\n3. Updating task services\n4. Rolling updates\n5. Rollback procedures\n6. Verification\n\n## Update Strategies\n\n### Strategy 1: In-Place Updates (Fastest)\n\n**Best for**: Non-critical environments, development, staging\n\n```\n# Direct update without downtime consideration\nprovisioning t create <taskserv> --infra <project>\n```\n\n### Strategy 2: Rolling Updates (Recommended)\n\n**Best for**: Production environments, high availability\n\n```\n# Update servers one by one\nprovisioning s update --infra <project> --rolling\n```\n\n### Strategy 3: Blue-Green Deployment (Safest)\n\n**Best for**: Critical production, zero-downtime requirements\n\n```\n# Create new infrastructure, switch traffic, remove old\nprovisioning ws init <project>-green\n# ... configure and deploy\n# ... switch traffic\nprovisioning ws delete <project>-blue\n```\n\n## Step 1: Check for Updates\n\n### 1.1 Check All Task Services\n\n```\n# Check all taskservs for updates\nprovisioning t check-updates\n```\n\n**Expected Output:**\n\n```\n📦 Task Service Update Check:\n\nNAME CURRENT LATEST STATUS\nkubernetes 1.29.0 1.30.0 ⬆️ update available\ncontainerd 1.7.13 1.7.13 ✅ up-to-date\ncilium 1.14.5 1.15.0 ⬆️ update available\npostgres 15.5 16.1 ⬆️ update available\nredis 7.2.3 7.2.3 ✅ up-to-date\n\nUpdates available: 3\n```\n\n### 1.2 Check Specific Task Service\n\n```\n# Check specific taskserv\nprovisioning t check-updates kubernetes\n```\n\n**Expected Output:**\n\n```\n📦 Kubernetes Update Check:\n\nCurrent: 1.29.0\nLatest: 1.30.0\nStatus: ⬆️ Update available\n\nChangelog:\n • Enhanced security features\n • Performance improvements\n • Bug fixes in kube-apiserver\n • New workload resource types\n\nBreaking Changes:\n • None\n\nRecommended: ✅ Safe to update\n```\n\n### 1.3 Check Version Status\n\n```\n# Show detailed version information\nprovisioning version show\n```\n\n**Expected Output:**\n\n```\n📋 Component Versions:\n\nCOMPONENT CURRENT LATEST DAYS OLD STATUS\nkubernetes 1.29.0 1.30.0 45 ⬆️ update\ncontainerd 1.7.13 1.7.13 0 ✅ current\ncilium 1.14.5 1.15.0 30 ⬆️ update\npostgres 15.5 16.1 60 ⬆️ update (major)\nredis 7.2.3 7.2.3 0 ✅ current\n```\n\n### 1.4 Check for Security Updates\n\n```\n# Check for security-related updates\nprovisioning version updates --security-only\n```\n\n## Step 2: Plan Your Update\n\n### 2.1 Review Current Configuration\n\n```\n# Show current infrastructure\nprovisioning show settings --infra my-production\n```\n\n### 2.2 Backup Configuration\n\n```\n# Create configuration backup\ncp -r workspace/infra/my-production workspace/infra/my-production.backup-$(date +%Y%m%d)\n\n# Or use built-in backup\nprovisioning ws backup my-production\n```\n\n**Expected Output:**\n\n```\n✅ Backup created: workspace/backups/my-production-20250930.tar.gz\n```\n\n### 2.3 Create Update Plan\n\n```\n# Generate update plan\nprovisioning plan update --infra my-production\n```\n\n**Expected Output:**\n\n```\n📝 Update Plan for my-production:\n\nPhase 1: Minor Updates (Low Risk)\n • containerd: No update needed\n • redis: No update needed\n\nPhase 2: Patch Updates (Medium Risk)\n • cilium: 1.14.5 → 1.15.0 (estimated 5 minutes)\n\nPhase 3: Major Updates (High Risk - Requires Testing)\n • kubernetes: 1.29.0 → 1.30.0 (estimated 15 minutes)\n • postgres: 15.5 → 16.1 (estimated 10 minutes, may require data migration)\n\nRecommended Order:\n 1. Update cilium (low risk)\n 2. Update kubernetes (test in staging first)\n 3. Update postgres (requires maintenance window)\n\nTotal Estimated Time: 30 minutes\nRecommended: Test in staging environ
|