Skip to content

lookout state edges

Verify every dependency edge of one workload — ConfigMap/Secret keys, imagePullSecrets, Service selectors and endpoints, Ingress backends and class, StatefulSet governing Service and volume classes, ServiceAccount/RBAC references, TLS expiry — reporting only the broken ones. With —namespace or -A and no —workload it sweeps the whole scope instead, including every kubernetes.io/tls Secret for certificate expiry whether or not anything mounts it (a cert an external load balancer serves), saying what references each one. —workload also accepts Service/<namespace>/<name> to enter from the service side, which is the direction the evidence arrives from when a service has no endpoints: it reports that service’s selector, endpoints, ingresses and certificates, and names the workload the selector was probably meant for. Under a role that may not list Secrets or RBAC objects (the built-in view), those edges come back as read.unavailable with the reason and every other edge is still verified.

MCP tool: k8s_state_edges (MCP profile: triage)

Terminal window
lookout state edges [flags]
FlagTypeDefaultMeaning
--cert-warnduration720hreport TLS certificates expiring within this window
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
edge.missing_refcriticala referenced ConfigMap, Secret, ServiceAccount, TLS secret, IngressClass, StorageClass, or governing Service does not exist
edge.missing_keycriticalthe referenced key is absent from an existing ConfigMap/Secret
edge.invalid_refwarningthe referenced object exists but is the wrong type to serve the reference
edge.unclassedwarningthe Ingress names no class and no IngressClass declares itself the cluster default — no controller will claim it
edge.selector_emptycritical, infoa Service selector selects zero pods, so the service routes nowhere; info, not critical, when every workload it matches is scaled to zero on purpose
edge.selector_unreadycritical, warningthe Service selects pods but some are not Ready; critical when none are
edge.endpoints_missingcriticala selecting Service has no EndpointSlices at all
edge.endpoints_orphanedwarningan endpoint targetRef names a pod that no longer exists
edge.endpoints_unreadycritical, warningthe endpoint ready-count disagrees with the selected pods (stale or lagging slices); critical at zero ready
edge.backend_missingcriticalan Ingress backend service, or the port it names, does not exist
edge.cert_expiredcritical, warninga TLS certificate’s NotAfter is in the past (a bundle is judged by its earliest-expiring certificate); warning instead of critical when the target-free TLS Secret sweep finds nothing in the cluster referencing the Secret (referenced_by=none)
edge.cert_expiringwarninga TLS certificate expires within —cert-warn — one a workload or Ingress reaches, or, in the target-free sweep, any kubernetes.io/tls Secret in scope, referenced or not
edge.cert_invalidwarning, infotls.crt is missing or unparseable, or the secret is not kubernetes.io/tls; info instead of warning when the target-free TLS Secret sweep finds nothing referencing the Secret
edge.rbac_danglingwarninga (Cluster)RoleBinding for the workload’s ServiceAccount points at a missing (Cluster)Role
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
workloadthe target the edges were traced from as <Kind>/<namespace>/<name>, stamped on every finding — a workload, or the Service itself when entered from the service side
likely_workloadon a Service-entry edge.selector_empty: the workload in that namespace whose pod labels best fit the broken selector, i.e. the one it was probably meant to select. Absent when two workloads fit equally well, because then naming one would be a guess
scaled_to_zeroon an info edge.selector_empty (reason BackendScaledToZero): the Deployments or StatefulSets the selector matches, as <Kind>/<name>, every one of them asking for zero replicas. The Service routes nowhere until one scales up, but nothing is misconfigured
podshow many of the workload’s pods carry the broken reference
containercontainer declaring the broken env/envFrom reference
envenvironment variable whose valueFrom reference is broken
volumepod volume, or StatefulSet volumeClaimTemplate, whose reference is broken
keythe referenced key that is missing from the ConfigMap/Secret
selectorthe Service label selector under scrutiny
selectedpods the Service selector currently selects
readyready count (selected pods or serving endpoints, per finding kind)
endpointstotal endpoints across the Service’s EndpointSlices
sliceshow many EndpointSlices back the Service
servicethe Service a slice, Ingress backend, or StatefulSet serviceName refers to
podpod named by an orphaned endpoint targetRef
subjectTLS certificate subject (CN when set); never key material
sansTLS certificate subject alternative names (DNS, then IP, URI, email), comma-separated, the first 5 then +N more; omitted when the certificate has none
referenced_byon a certificate finding from the target-free TLS Secret sweep: what in the Secret’s namespace references it, as <Kind>/<name> — workloads by pod template, pods no workload owns, Ingresses by tls — the first 5 then +N more. none = no pod volume, projected volume, env, envFrom or Ingress tls names it (its consumer is outside the cluster, or a Gateway listener, which this pass does not read); unknown = a List those references come from was refused
not_afterTLS certificate NotAfter, RFC 3339
days_leftwhole days until NotAfter (negative = expired)
viahow the broken reference is reached from the workload: mount, ingress, or imagePullSecret; absent on the TLS Secret sweep’s findings, which carry referenced_by instead
ingressIngress referencing the TLS secret, or the unserved Ingress itself
hostIngress rule host of the broken backend (empty for the default backend)
pathIngress rule path of the broken backend
portService port (name or number) the Ingress backend asks for
service_accountServiceAccount the RBAC finding is about, or the one contributing an imagePullSecret
role_refdangling roleRef as <Kind>/<name>
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 edges --workload=Deployment/prod/api
lookout state edges --workload=Pod/prod/api-6d5f8c-x2v9k --format=json
lookout state edges --workload=StatefulSet/db/postgres --cert-warn=336h
lookout state edges --workload=Service/prod/api
lookout state edges -A --cert-warn=336h