diff --git a/scripts/check_214_pods.py b/scripts/check_214_pods.py new file mode 100644 index 0000000..9b2da87 --- /dev/null +++ b/scripts/check_214_pods.py @@ -0,0 +1,25 @@ +import paramiko +import sys + +sys.stdout.reconfigure(encoding='utf-8') + +client = paramiko.SSHClient() +client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) +key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet" + +client.connect("140.44.4.11", username="root", key_filename=key_path, timeout=15) +stdin, stdout, stderr = client.exec_command("KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl -n cattle-system get pods -o wide") +print("=== PODS IN CATTLE-SYSTEM ===") +print(stdout.read().decode('utf-8')) + +stdin, stdout, stderr = client.exec_command("KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl -n cattle-system rollout status deployment/rancher --timeout=30s") +print("=== ROLLOUT STATUS ===") +print(stdout.read().decode('utf-8')) +print(stderr.read().decode('utf-8')) + +stdin, stdout, stderr = client.exec_command("curl -k -I -s https://aerodrome.snarfnet.net | head -n 10") +print("=== ENDPOINT ===") +print(stdout.read().decode('utf-8')) + +client.close() + diff --git a/scripts/check_helm_cattle.py b/scripts/check_helm_cattle.py new file mode 100644 index 0000000..c395aa6 --- /dev/null +++ b/scripts/check_helm_cattle.py @@ -0,0 +1,14 @@ +import paramiko +import sys + +sys.stdout.reconfigure(encoding='utf-8') + +client = paramiko.SSHClient() +client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) +key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet" + +client.connect("140.44.4.11", username="root", key_filename=key_path, timeout=15) +stdin, stdout, stderr = client.exec_command("KUBECONFIG=/etc/rancher/k3s/k3s.yaml helm list -n cattle-system") +print(stdout.read().decode('utf-8')) +client.close() + diff --git a/scripts/step_rancher.py b/scripts/step_rancher.py index 3148dc8..c7602e2 100644 --- a/scripts/step_rancher.py +++ b/scripts/step_rancher.py @@ -61,8 +61,8 @@ sed -i '/kubeVersion:/d' /tmp/rancher-hop/rancher/Chart.yaml run_cmd(upgrade_cmd) # 4. Wait for deployment rollout - print("\n--- 4. Waiting for deployment/rancher rollout status (timeout 400s) ---") - run_cmd("kubectl -n cattle-system rollout status deployment/rancher --timeout=400s") + print("\n--- 4. Waiting for deployment/rancher rollout status (timeout 600s) ---") + run_cmd("kubectl -n cattle-system rollout status deployment/rancher --timeout=600s") # 5. Check cattle-system pods print("\n--- 5. Checking cattle-system pods ---") diff --git a/scripts/test_dryrun_2153.py b/scripts/test_dryrun_2153.py new file mode 100644 index 0000000..111dc82 --- /dev/null +++ b/scripts/test_dryrun_2153.py @@ -0,0 +1,27 @@ +import paramiko +import sys + +sys.stdout.reconfigure(encoding='utf-8') + +client = paramiko.SSHClient() +client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) +key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet" + +client.connect("140.44.4.11", username="root", key_filename=key_path, timeout=15) + +test_cmd = """ +rm -rf /tmp/rancher-2153 && mkdir -p /tmp/rancher-2153 && cd /tmp/rancher-2153 +KUBECONFIG=/etc/rancher/k3s/k3s.yaml helm pull rancher-stable/rancher --version 2.15.3 --untar +sed -i '/kubeVersion:/d' rancher/Chart.yaml +KUBECONFIG=/etc/rancher/k3s/k3s.yaml helm upgrade rancher ./rancher --namespace cattle-system \ + --set hostname=aerodrome.snarfnet.net --set ingress.tls.source=secret --dry-run +""" + +stdin, stdout, stderr = client.exec_command(test_cmd) +out = stdout.read().decode('utf-8') +err = stderr.read().decode('utf-8') +print("STDOUT:", out[:400]) +print("STDERR:", err) + +client.close() +