From 8a186262b025679fae50cf60c3deaad9cf694ca8 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Wed, 21 Oct 2026 11:37:11 -0600 Subject: [PATCH] feat: add Pimox control-plane disk diagnostics --- scripts/workers | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/scripts/workers b/scripts/workers index 8d6c479..7ec094e 100755 --- a/scripts/workers +++ b/scripts/workers @@ -27,6 +27,7 @@ Commands: recreate-plan [index|all] Print the safe recreate sequence for Pimox worker(s) rebalance Restart evicted/pending pods and show scheduling pressure disk-status [index|all] Read-only filesystem and container-runtime pressure report + disk-status control-plane Read-only control-plane VM filesystem/runtime report disk-cleanup [index|all] [--yes] Prune unused images and old pod logs on selected worker(s) EOF @@ -282,10 +283,37 @@ worker_entry() { printf '%s\t%s\t%s\t%s\n' "${host}" "${user}" "${key}" "${node}" } +control_plane_entry() { + local host="${LAB_PIMOX_CONTROL_PLANE_IP:-${LAB_CLUSTER_CONTROL_PLANE_LAN_IP:-192.168.100.65}}" + local user="${LAB_PIMOX_CONTROL_PLANE_USER:-${LAB_CLUSTER_CONTROL_PLANE_USER:-jv}}" + local key="${LAB_PIMOX_CONTROL_PLANE_SSH_KEY_PATH:-${LAB_CLUSTER_CONTROL_PLANE_SSH_KEY_PATH:-${HOME}/.ssh/id_ed25519}}" + printf '%s\t%s\t%s\t%s\n' "${host}" "${user}" "${key}" "${LAB_CLUSTER_CONTROL_PLANE_NODE_NAME:-pimox-cp-01}" +} + disk_status() { local target="${1:-all}" local index host user key node + if [[ "${target}" == "control-plane" || "${target}" == "cp" ]]; then + IFS=$'\t' read -r host user key node < <(control_plane_entry) + echo "===== control plane (${node}, ${host}) =====" + ssh -i "${key}" -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new "${user}@${host}" 'bash -s' <<'REMOTE' +set +e +echo "-- filesystem" +df -hP / /var/lib/containerd /var/lib/kubelet /var/log 2>/dev/null || true +echo "-- container runtime image filesystem" +sudo crictl imagefsinfo 2>/dev/null || true +echo "-- runtime services" +systemctl is-active containerd 2>/dev/null || true +systemctl is-active kubelet 2>/dev/null || true +echo "-- largest relevant paths" +sudo du -xhd1 /var/lib/containerd /var/lib/kubelet /var/log/pods /var/log/containers 2>/dev/null | sort -h | tail -n 20 || true +echo "-- recent control-plane errors" +sudo journalctl -u kubelet -u containerd --since '2 hours ago' --no-pager 2>/dev/null | grep -Ei 'timeout|no space|diskpressure|evict|apiserver|etcd|failed' | tail -n 40 || true +REMOTE + return 0 + fi + for index in $(target_indexes "${target}"); do IFS=$'\t' read -r host user key node < <(worker_entry "${index}") echo "===== worker ${index} (${node}, ${host}) ====="