feat: add cluster auditing, management, and upgrade scripts
This commit is contained in:
23
scripts/inspect_coder_data_to_persist.py
Normal file
23
scripts/inspect_coder_data_to_persist.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import paramiko
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.41', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
def run(cmd):
|
||||
print(f"=== {cmd} ===")
|
||||
_, out, err = ssh.exec_command(cmd)
|
||||
res = out.read().decode().strip()
|
||||
if res:
|
||||
print(res)
|
||||
e = err.read().decode().strip()
|
||||
if e:
|
||||
print("ERR:", e)
|
||||
|
||||
run("kubectl get pods -n infrastructure -l app.kubernetes.io/name=coder")
|
||||
run("kubectl exec -n infrastructure deployment/coder -- ls -la /home/coder")
|
||||
run("kubectl exec -n infrastructure deployment/coder -- du -sh /home/coder/.config/coderv2")
|
||||
run("curl -s https://coder.snarfnet.net/api/v2/users/first")
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user