feat: add homelab deployment configs, documentation, and automation scripts

This commit is contained in:
2026-11-12 16:57:08 -05:00
parent 1228b957de
commit 5a70460e89
270 changed files with 9709 additions and 47 deletions

View File

@@ -0,0 +1,33 @@
import paramiko, json
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('140.44.4.90', username='rancher', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
def run(cmd):
full_cmd = "echo Katzir476! | sudo -S sh -c 'export KUBECONFIG=/etc/rancher/rke2/rke2.yaml; PATH=$PATH:/var/lib/rancher/rke2/bin; " + cmd + "'"
stdin, stdout, stderr = c.exec_command(full_cmd)
return stdout.read().decode().strip()
print("=== Blockdevices on Harvester ===")
print(run("kubectl get blockdevices.harvesterhci.io -A -o wide"))
print("\n=== Longhorn storage on Harvester nodes ===")
out = run("kubectl get nodes.longhorn.io -n longhorn-system -o json")
data = json.loads(out)
total_max = 0
total_avail = 0
num_disks = 0
for n in data['items']:
disks = n.get('status', {}).get('diskStatus', {})
for d_name, d_val in disks.items():
num_disks += 1
total_max += d_val.get('storageMaximum', 0)
total_avail += d_val.get('storageAvailable', 0)
tib = total_max / (1024**4)
avail_tib = total_avail / (1024**4)
print(f"Harvester Disks: {num_disks}, Total Storage: {tib:.2f} TiB, Available: {avail_tib:.2f} TiB")
c.close()