Homelab


Why?

Requirements

  • Declarative (immutable)
  • Explore the idea of using k8s or k3s, mainly for learning, and k3s seems a nice balance for lab use
  • Redundant and simple

Current State

Why LLMs

case "$1" in
    "nodes")
        curl -s -k -H "$TOKEN" "$API_URL/nodes" | jq '.data[]'
        ;;
    "vms")
        curl -s -k -H "$TOKEN" "$API_URL/nodes/pve-staging/qemu" | jq '.data[]'
        ;;
    "vm")
        if [ -z "$2" ]; then
            echo "Usage: $0 vm <vmid>"
            exit 1
        fi
        curl -s -k -H "$TOKEN" "$API_URL/nodes/pve-staging/qemu/$2/status/current" | jq '.data'
        ;;
    "templates")
        curl -s -k -H "$TOKEN" "$API_URL/nodes/pve-staging/qemu" | jq '.data[] | select(.template == 1)'
        ;;
    "running")
        curl -s -k -H "$TOKEN" "$API_URL/nodes/pve-staging/qemu" | jq '.data[] | select(.status == "running")'
        ;;
    *)
        echo "Usage: $0 {nodes|vms|vm <vmid>|templates|running}"
        echo "Examples:"
        echo "  $0 nodes     # List all nodes"
        echo "  $0 vms       # List all VMs"
        echo "  $0 vm 201    # Get details for VM 201"