Skip to content

lookout stab scaledown

On a cluster-autoscaled cluster, which underused nodes the autoscaler cannot remove and what pins each one — a cost read: nodes requested below —utilization (the autoscaler’s own 50% default) that carry a zero-disruption PDB, a controller-less pod, or a safe-to-evict=false pod; scanned counts nodes examined.

MCP tool: k8s_scaledown_blockers

Terminal window
lookout stab scaledown [flags]
FlagTypeDefaultMeaning
--utilizationint50percent of allocatable (requests, max of CPU and memory; GPU alone on GPU nodes) below which a node counts as underused; default 50 is the cluster autoscaler’s own —scale-down-utilization-threshold, so match it if yours is tuned (1-100)
FlagTypeDefaultMeaning
--namespacestring—limit the scan to one namespace
-Abool—scan all namespaces
--workloadstring—target one workload as <Kind>/<namespace>/<name>, e.g. Deployment/prod/api
--sinceduration—how far back to look (0 = command default)
--formatstringlogfmtoutput format: logfmt|json (one record per line either way)
--timeoutduration10sabort the invocation after this long (exit 1)
--kubeconfigstring—path to a kubeconfig file, instead of $KUBECONFIG / ~/.kube/config
--kubeconfig-dirstring—directory of kubeconfig files to fan out across (mutually exclusive with —kubeconfig); each finding is stamped with cluster=<label> and the summary reports clusters=<n>
--contextstring—kubeconfig context to read, instead of its current-context. Selects a cluster for THIS invocation only — nothing is written back — so concurrent invocations can target different clusters. Reported as context=<name> in the summary line
--contextsstring—comma-separated kubeconfig contexts to fan out across, or ’*’ for every context in the selected kubeconfig(s) (mutually exclusive with —context); each finding is stamped with cluster=<label> and the summary reports clusters=<n>
--concurrencyint4maximum concurrent cluster executions when fanning out with —contexts or —kubeconfig-dir
--google-authstring—how Google Cloud and GKE DNS requests authenticate: auto (default: honors LOOKOUT_GOOGLE_AUTH, CORE_AGENT_GOOGLE_AUTH, MAST_GOOGLE_AUTH), adc, or injected (static placeholder bearer token, zero GCE metadata lookups)
--exemptionsstring—path to a git-reviewed exemption file (YAML); covered findings are ANNOTATED with their reason and expiry and counted as exempt=<n> in the summary, never dropped

Every kind= this command can emit, and the severities it carries them at. Nothing else appears in its output; a kind absent from a run means the check looked and found nothing. See the finding-kind glossary for the whole vocabulary.

KindSeverityClaim
scaledown.blockedwarningthe node is requested below —utilization, so the autoscaler would remove it, but a pod on it cannot be moved — a zero-disruption PDB, a pod with no controller, or a pod annotated safe-to-evict=false — so it keeps billing at low utilization
read.unavailableinfoa resource this command reads was refused (RBAC forbidden, e.g. Nodes, Secrets or RBAC objects under the built-in view role) or is not served, so the checks that need it did not run and their silence is not a clean bill; everything else was still verified. The message names the refused verb and resource, whether it is cluster-scoped, whether the built-in view role grants it, and the grant that fixes it; resource= carries the refused resource as resource[.group] — an explicit degradation record, never silence

Beyond the shared envelope fields (kind, severity, namespace, kind_of_object, name, reason, message, fingerprint, exempt_reason, exempt_expires):

FieldMeaning
utilizationthe node’s requested share of allocatable on the deciding resource, whole percent, rounded down
basisthe deciding resource: cpu or memory (whichever is higher), or gpu on a node that offers GPUs
thresholdthe —utilization the node was judged against, in percent
nodepoolthe node’s pool, from the provider’s pool label; omitted when the node carries none
blockerspods and PDBs pinning the node, counted
pdb_gridlockPodDisruptionBudgets allowing zero disruptions over a pod on the node; omitted at 0
bare_podspods with no controller and no safe-to-evict=true annotation; omitted at 0
not_safe_to_evictpods annotated cluster-autoscaler.kubernetes.io/safe-to-evict=false; omitted at 0
blocked_bythe pinning objects as <Kind>/<namespace>/<name>, sorted, capped at 8 with a +N more tail
nodessummary note: nodes listed
excludedsummary note: nodes the autoscaler never removes and so were not judged — control-plane, annotated scale-down-disabled, or already tainted for deletion
underusedsummary note: judged nodes below —utilization, blocked or not
resourceread.unavailable: the resource that could not be read, as resource[.group]

Output: one finding per line (logfmt; —format=json for one JSON object per line), keys in fixed order; healthy resources emit nothing. The final line is always the summary: scanned= findings= elapsed= — findings=0 with a summary present means “scanned and healthy”; a stream without a summary line is void. Exit 0 data, 1 runtime error (diagnostics on stderr only), 2 usage.

Terminal window
lookout stab scaledown
lookout stab scaledown --utilization=65
lookout stab scaledown --format=json