|
| 1 | +# CLI Reference (`scalex`) |
| 2 | + |
| 3 | +The `scalex` CLI is the primary tool for managing the entire ScaleX-POD-mini platform — from hardware facts gathering through SDI virtualization to multi-cluster provisioning. |
| 4 | + |
| 5 | +## Build |
| 6 | + |
| 7 | +```bash |
| 8 | +cd scalex-cli && cargo build --release |
| 9 | +# Binary: target/release/scalex |
| 10 | +``` |
| 11 | + |
| 12 | +## Core Commands |
| 13 | + |
| 14 | +| Command | Description | |
| 15 | +|---------|-------------| |
| 16 | +| `scalex facts --all` | Gather hardware info from all bare-metal nodes | |
| 17 | +| `scalex facts --host <name>` | Gather from a single node | |
| 18 | +| `scalex sdi init <sdi-specs.yaml>` | Virtualize bare-metal → resource pool → VM pools | |
| 19 | +| `scalex sdi clean --hard --yes-i-really-want-to` | Full infrastructure reset | |
| 20 | +| `scalex sdi sync` | Reconcile bare-metal changes (add/remove nodes) | |
| 21 | +| `scalex cluster init <k8s-clusters.yaml>` | Kubespray → multi-cluster provisioning | |
| 22 | +| `scalex secrets apply` | Generate and apply pre-bootstrap K8s secrets | |
| 23 | +| `scalex bootstrap` | Install ArgoCD + register clusters + apply spread.yaml | |
| 24 | + |
| 25 | +## Query Commands |
| 26 | + |
| 27 | +| Command | Description | |
| 28 | +|---------|-------------| |
| 29 | +| `scalex get baremetals` | Hardware facts table | |
| 30 | +| `scalex get sdi-pools` | VM pool status | |
| 31 | +| `scalex get clusters` | Cluster inventory | |
| 32 | +| `scalex get config-files` | Config file validation | |
| 33 | +| `scalex validate` | Pre-provisioning config validation (YAML parsing, IP/CIDR conflicts, pool mapping) | |
| 34 | +| `scalex status` | 5-layer platform status report | |
| 35 | +| `scalex kernel-tune` | Kernel parameter recommendations and diff | |
| 36 | + |
| 37 | +## Quick Reference |
| 38 | + |
| 39 | +```bash |
| 40 | +scalex facts --all # HW facts |
| 41 | +scalex sdi init config/sdi-specs.yaml # VM pools |
| 42 | +scalex cluster init config/k8s-clusters.yaml # K8s clusters |
| 43 | +scalex secrets apply # Secrets |
| 44 | +scalex bootstrap # ArgoCD + GitOps |
| 45 | +scalex status # Full status |
| 46 | +scalex get clusters # Cluster list |
| 47 | +scalex sdi clean --hard --yes-i-really-want-to # Full reset |
| 48 | +``` |
| 49 | + |
| 50 | +## VM Resource Budget |
| 51 | + |
| 52 | +`scalex plan` computes VM specs from component budgets. Source: `resource_planner.rs` |
| 53 | + |
| 54 | +| Cluster Role | CPU (mc) | RAM (MB) | Disk (MB) | VM Spec (vCPU / GB / disk GB) | |
| 55 | +|--------------|----------|----------|-----------|-------------------------------| |
| 56 | +| **Management** (Tower) | 2,450 | 3,904 | 11,136 | **3 / 4 / 20** | |
| 57 | +| **Workload** (Sandbox) | 1,450 | 2,368 | 8,064 | **2 / 3 / 20** | |
| 58 | + |
| 59 | +> Included: base-os, k8s-cp, cilium, coredns, argocd(mgmt), cert-manager, kyverno, keycloak(mgmt), cloudflared(mgmt), local-path(workload) |
| 60 | +> VM conversion: `vCPU = ceil(mc/1000)`, `GB = ceil(MB/1024)`, `disk = max(ceil(MB/1024), 20)` |
| 61 | +
|
| 62 | +## Config Files |
| 63 | + |
| 64 | +| File | Purpose | |
| 65 | +|------|---------| |
| 66 | +| `credentials/.baremetal-init.yaml` | SSH access to bare-metal nodes | |
| 67 | +| `credentials/.env` | SSH passwords/key paths | |
| 68 | +| `credentials/secrets.yaml` | Keycloak, ArgoCD, Cloudflare secrets | |
| 69 | +| `config/sdi-specs.yaml` | VM pool definitions (CPU, RAM, disk, GPU) | |
| 70 | +| `config/k8s-clusters.yaml` | Cluster definitions (mode, role, addons) | |
0 commit comments