feat: add cluster auditing, management, and upgrade scripts
This commit is contained in:
21
scripts/inspect_coder_helm.py
Normal file
21
scripts/inspect_coder_helm.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import paramiko
|
||||
import base64
|
||||
import gzip
|
||||
import json
|
||||
|
||||
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)
|
||||
|
||||
_, out, _ = ssh.exec_command('kubectl get secret -n infrastructure sh.helm.release.v1.coder.v5 -o jsonpath="{.data.release}"')
|
||||
raw = out.read().decode().strip()
|
||||
if raw:
|
||||
data = base64.b64decode(raw)
|
||||
data = base64.b64decode(data) # helm encodes twice
|
||||
decomp = gzip.decompress(data)
|
||||
rel = json.loads(decomp)
|
||||
print("Chart:", rel.get('chart', {}).get('metadata', {}).get('version'))
|
||||
print("Values:", json.dumps(rel.get('config', {}), indent=2))
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user