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)
lookout state edges [flags]| Flag | Type | Default | Meaning |
|---|---|---|---|
--cert-warn | duration | 720h | report TLS certificates expiring within this window |
Common flags (every lookout command)
Section titled “Common flags (every lookout command)”| Flag | Type | Default | Meaning |
|---|---|---|---|
--namespace | string | — | limit the scan to one namespace |
-A | bool | — | scan all namespaces |
--workload | string | — | target one workload as <Kind>/<namespace>/<name>, e.g. Deployment/prod/api |
--since | duration | — | how far back to look (0 = command default) |
--format | string | logfmt | output format: logfmt|json (one record per line either way) |
--timeout | duration | 10s | abort the invocation after this long (exit 1) |
--kubeconfig | string | — | path to a kubeconfig file, instead of $KUBECONFIG / ~/.kube/config |
--kubeconfig-dir | string | — | 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> |
--context | string | — | 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 |
--contexts | string | — | 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> |
--concurrency | int | 4 | maximum concurrent cluster executions when fanning out with —contexts or —kubeconfig-dir |
--google-auth | string | — | 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) |
--exemptions | string | — | 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 |
Finding kinds
Section titled “Finding kinds”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.
| Kind | Severity | Claim |
|---|---|---|
edge.missing_ref | critical | a referenced ConfigMap, Secret, ServiceAccount, TLS secret, IngressClass, StorageClass, or governing Service does not exist |
edge.missing_key | critical | the referenced key is absent from an existing ConfigMap/Secret |
edge.invalid_ref | warning | the referenced object exists but is the wrong type to serve the reference |
edge.unclassed | warning | the Ingress names no class and no IngressClass declares itself the cluster default — no controller will claim it |
edge.selector_empty | critical, info | a 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_unready | critical, warning | the Service selects pods but some are not Ready; critical when none are |
edge.endpoints_missing | critical | a selecting Service has no EndpointSlices at all |
edge.endpoints_orphaned | warning | an endpoint targetRef names a pod that no longer exists |
edge.endpoints_unready | critical, warning | the endpoint ready-count disagrees with the selected pods (stale or lagging slices); critical at zero ready |
edge.backend_missing | critical | an Ingress backend service, or the port it names, does not exist |
edge.cert_expired | critical, warning | a 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_expiring | warning | a 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_invalid | warning, info | tls.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_dangling | warning | a (Cluster)RoleBinding for the workload’s ServiceAccount points at a missing (Cluster)Role |
read.unavailable | info | a 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 |
Output fields
Section titled “Output fields”Beyond the shared envelope fields (kind, severity, namespace, kind_of_object, name, reason, message, fingerprint, exempt_reason, exempt_expires):
| Field | Meaning |
|---|---|
workload | the 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_workload | on 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_zero | on 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 |
pods | how many of the workload’s pods carry the broken reference |
container | container declaring the broken env/envFrom reference |
env | environment variable whose valueFrom reference is broken |
volume | pod volume, or StatefulSet volumeClaimTemplate, whose reference is broken |
key | the referenced key that is missing from the ConfigMap/Secret |
selector | the Service label selector under scrutiny |
selected | pods the Service selector currently selects |
ready | ready count (selected pods or serving endpoints, per finding kind) |
endpoints | total endpoints across the Service’s EndpointSlices |
slices | how many EndpointSlices back the Service |
service | the Service a slice, Ingress backend, or StatefulSet serviceName refers to |
pod | pod named by an orphaned endpoint targetRef |
subject | TLS certificate subject (CN when set); never key material |
sans | TLS certificate subject alternative names (DNS, then IP, URI, email), comma-separated, the first 5 then +N more; omitted when the certificate has none |
referenced_by | on 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_after | TLS certificate NotAfter, RFC 3339 |
days_left | whole days until NotAfter (negative = expired) |
via | how 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 |
ingress | Ingress referencing the TLS secret, or the unserved Ingress itself |
host | Ingress rule host of the broken backend (empty for the default backend) |
path | Ingress rule path of the broken backend |
port | Service port (name or number) the Ingress backend asks for |
service_account | ServiceAccount the RBAC finding is about, or the one contributing an imagePullSecret |
role_ref | dangling roleRef as <Kind>/<name> |
resource | read.unavailable: the resource that could not be read, as resource[.group] |
Output contract
Section titled “Output contract”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=
Examples
Section titled “Examples”lookout state edges --workload=Deployment/prod/apilookout state edges --workload=Pod/prod/api-6d5f8c-x2v9k --format=jsonlookout state edges --workload=StatefulSet/db/postgres --cert-warn=336hlookout state edges --workload=Service/prod/apilookout state edges -A --cert-warn=336h