feat: add scripts to inspect and check Rancher deployments via SSH
This commit is contained in:
26
scripts/inspect_rancher_installation.py
Normal file
26
scripts/inspect_rancher_installation.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import paramiko
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.11', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
def run(cmd):
|
||||
print(f"\n=== {cmd} ===")
|
||||
_, out, err = ssh.exec_command(cmd)
|
||||
res = out.read().decode('utf-8', errors='replace').strip()
|
||||
if res:
|
||||
print(res)
|
||||
e = err.read().decode('utf-8', errors='replace').strip()
|
||||
if e:
|
||||
print("ERR:", e)
|
||||
|
||||
run("kubectl get deploy,sts,ds -n cattle-system -o wide")
|
||||
run("kubectl get pods -n cattle-system -o wide")
|
||||
run("kubectl get deploy -n cattle-system rancher -o yaml | grep -E 'image:'")
|
||||
run("kubectl get secrets -n cattle-system | grep -i helm")
|
||||
run("kubectl get helmcharts,helmchartconfigs -A | grep -i rancher")
|
||||
run("kubectl get ns | grep -E 'cert-manager|cattle'")
|
||||
run("kubectl get pods -n cert-manager 2>/dev/null || true")
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user