Commit 58b2a0c
committed
feat: add crc ssh and crc vm stats commands
Add direct SSH access to the CRC VM via 'crc ssh' with support for
interactive shells (syscall.Exec) and remote commands (exec.Command).
Add 'crc vm stats' to display comprehensive VM diagnostics including
OS info, CPU/memory/disk usage, network config, container stats,
service health, and OOM/fault counters. Supports -o json output
for scripting.
Usage examples:
$ crc ssh -- hostname
crc
$ crc ssh -- cat /etc/redhat-release
Red Hat Enterprise Linux release 9.6 (Plow)
$ crc ssh # opens interactive shell
$ crc vm stats
System
────────
OS: Red Hat Enterprise Linux CoreOS 9.6.20260225-1 (Plow)
Kernel: 5.14.0-570.94.1.el9_6.aarch64 (aarch64)
Uptime: 4h 0m
CPU
─────
Cores: 4
Load Avg: 2.62 (1m) 2.06 (5m) 1.81 (15m)
Memory
────────
RAM: 6.953GB / 10.93GB [############........] 64%
Swap: disabled
Disk (/sysroot)
─────────────────
Usage: 25.51GB / 36.98GB [#############.......] 69%
Free: 11.47GB
Network
─────────
Node IP: 127.0.0.1
Cluster IP: 192.168.127.2
DNS: 192.168.127.1
Workload
──────────
Pods: 66
Containers: 104
Images: 66
Top Containers (by memory)
────────────────────────────
kube-apiserver: 1.46GB
ovnkube-controller: 262.2MB
openshift-apiserver: 255.7MB
etcd: 247.4MB
kube-controller-manager: 185MB
Services
──────────
kubelet: ok
crio: ok
Health
────────
OOM Kills: 0
Major Page Faults: 258166
$ crc vm stats -o json # JSON output for scripting1 parent 5114f3d commit 58b2a0c
5 files changed
+559
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments