Skip to content

lookout state volumes

When pods hang in ContainerCreating with Multi-Attach or FailedAttachVolume events — join VolumeAttachment + PV/PVC + pods to name the exact conflict: RWO claims wanted on two nodes, attachments stuck in error, cross-zone PV locks, orphaned attachments; also names Bound claims nothing mounts or references (provisioned storage billing for nobody).

MCP tool: k8s_volume_conflicts

Terminal window
lookout state volumes [flags]
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
volume.multi_attachcriticalan RWO claim is wanted by pods on more than one node — the second pod never starts
volume.zone_conflictcriticalthe PV is locked to a zone the pod’s node is not in
volume.attach_errorcritical, warningthe attach or detach is failing; critical once it has been failing long enough to be stuck rather than slow
volume.orphaned_attachmentinfoa VolumeAttachment survives its PV or its node
volume.unconsumed_pvcinfoa Bound claim that no pod (in any phase) mounts and no workload template or live StatefulSet claim template references — its volume is provisioned and billed for nothing; consumers outside the built-in workload kinds (a VM operator, a CI workspace) are invisible here, so read it as a lead, not a verdict
volume.expansion_unsupportedwarninga Bound claim requests more storage than its current capacity, but its StorageClass does not allow volume expansion
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
podsscheduled pods referencing the conflicted claim, sorted (list capped, then +K more)
nodesdistinct nodes those pods are scheduled on, sorted
access_modesthe claim’s declared access modes
pvPersistentVolume behind the claim or attachment
pvcPersistentVolumeClaim the pod mounts (same namespace as the pod)
nodenode the attachment targets or the pod is scheduled on
attacherCSI driver responsible for the attachment (spec.attacher)
agehow long the attach/detach error has persisted, truncated to seconds
errorvolume.attach_error: the attach/detach error message, truncated to 200 chars (cloud.unavailable from cloud orphans, reason=SweepFailed or RuleUnresolved, uses the same key for the provider error — masked, cut to 300 characters)
attachedthe attachment’s status.attached at scan time
pv_zoneszones the PV’s node affinity allows, sorted
node_zonezone label of the node the pod is scheduled on
orphanwhich referenced side is gone: “pv missing”, “node missing”, or both
capacityvolume.unconsumed_pvc, volume.expansion_unsupported: the claim’s bound capacity (status.capacity.storage); omitted when unreported
requestedvolume.expansion_unsupported: the larger storage capacity requested in spec.resources.requests.storage
storage_classvolume.unconsumed_pvc, volume.expansion_unsupported: the claim’s StorageClass; omitted when it names none
reclaim_policyvolume.unconsumed_pvc: the bound PV’s reclaim policy — Delete means deleting the claim frees the disk, Retain means the PV must be deleted too; omitted when the PV is not visible
claim_agevolume.unconsumed_pvc: how long ago the claim was created, truncated to minutes
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 state volumes
lookout state volumes --namespace=prod
lookout state volumes --format=json