Revise wild-setup-cluster to use a single wild-node-setup to replace node-patch-generate and node-up.

This commit is contained in:
2025-10-01 03:52:16 -07:00
parent c7b29e5954
commit ecdb2f2916
9 changed files with 630 additions and 756 deletions

View File

@@ -67,20 +67,21 @@ Wild Cloud provides 34+ command-line tools (all prefixed with `wild-`) for manag
- Generates cluster secrets using `talosctl gen config`
- **Usage**: `wild-cluster-config-generate`
**`wild-node-detect`** - Hardware detection for nodes
**`wild-node-setup`** - Complete node lifecycle management
- Handles detect → patch → deploy for individual nodes
- Automatically detects maintenance mode
- Options: `--detect`, `--no-deploy`
- **Usage**: `wild-node-setup <node-name> [options]`
- **Examples**:
- `wild-node-setup control-1` (complete setup)
- `wild-node-setup worker-1 --detect` (force hardware re-detection)
- `wild-node-setup control-2 --no-deploy` (configuration only)
**`wild-node-detect`** - Hardware detection utility
- Discovers network interfaces and disks from maintenance mode
- Returns JSON with hardware specifications
- **Usage**: `wild-node-detect <node-ip>`
**`wild-cluster-node-patch-generate`** - Generate node-specific configs
- Creates patches based on hardware detection
- Uses templates with node-specific variables
- **Usage**: `wild-cluster-node-patch-generate <node-name>`
**`wild-cluster-node-up`** - Apply Talos configuration to nodes
- Options: `--insecure`, `--force`, `--dry-run`
- Generates final config from base + patch
- **Usage**: `wild-cluster-node-up <node-name> [options]`
- **Note**: Primarily used internally by `wild-node-setup`
**`wild-cluster-node-ip`** - Get node IP addresses
- Sources: config.yaml, kubectl, or talosctl
@@ -257,8 +258,9 @@ wild-health # Check system health
### Node Management Flow
1. `wild-cluster-config-generate` → base configurations
2. `wild-node-detect` → discover hardware
3. `wild-cluster-node-patch-generate` → node-specific configs
4. `wild-cluster-node-up` → apply configurations
2. `wild-node-setup <node-name>` → atomic node operations (detect → patch → deploy)
- Internally uses `wild-node-detect` for hardware discovery
- Generates node-specific patches and final configurations
- Deploys configuration to target node
All scripts are designed to work together as a cohesive Infrastructure as Code system for personal Kubernetes deployments.

View File

@@ -86,30 +86,22 @@ network:
- Creates cluster secrets using `talosctl gen config`
- Establishes foundation for all node configurations
#### 2. Hardware Detection
**Script**: `wild-node-detect`
#### 2. Node Setup (Atomic Operations)
**Script**: `wild-node-setup <node-name> [options]`
Interactive process for each node:
- Boots nodes into maintenance mode via PXE
- Detects network interfaces and storage devices
- Returns JSON specification of hardware capabilities
- Records node-specific configuration data
**Complete Node Lifecycle Management**:
- **Hardware Detection**: Discovers network interfaces and storage devices
- **Configuration Generation**: Creates node-specific patches and final configs
- **Deployment**: Applies Talos configuration to the node
#### 3. Node-Specific Configuration
**Script**: `wild-cluster-node-patch-generate`
**Options**:
- `--detect`: Force hardware re-detection
- `--no-deploy`: Generate configuration only, skip deployment
- Generates patches for individual nodes
- Uses templates with detected hardware specifications
- Creates node-specific machine configurations
- Handles IP addresses, interfaces, and disk layout
#### 4. Node Deployment
**Script**: `wild-cluster-node-up`
- Applies Talos configurations to nodes
- Supports `--insecure` for maintenance mode
- Generates final configs from base + patches
- Deploys both control plane and worker nodes
**Integration with Cluster Setup**:
- `wild-setup-cluster` automatically calls `wild-node-setup` for each node
- Individual node failures don't break cluster setup
- Clear retry instructions for failed nodes
### Cluster Architecture
@@ -363,8 +355,9 @@ wild-setup-services # Cluster services only
### Individual Operations
```bash
wild-cluster-config-generate # Generate base configs
wild-node-detect <ip> # Hardware detection
wild-cluster-node-up <node> # Deploy single node
wild-node-setup <node-name> # Complete node setup (detect → configure → deploy)
wild-node-setup <node-name> --detect # Force hardware re-detection
wild-node-setup <node-name> --no-deploy # Configuration only
wild-dashboard-token # Get dashboard access
wild-health # System health check
```