Skip to content

lookout audit workloads

Workload reliability posture for workloads that are healthy right now: no PodDisruptionBudget, only one replica, no readiness/liveness probe, no spread across nodes, placement pinned to too few nodes, autoscalers that structurally cannot scale, CronJobs left suspended long enough to have skipped runs, standalone Jobs left suspended past a maintenance window, and the rollout-safety claims for Service-backed workloads: liveness probes that fire before readiness on the same handler, serving containers with no preStop hook, and Deployment strategies that permit zero surviving pods. Answers “what has no safety net”, as against stab drain, which answers “what breaks if I drain THIS node now”. Scope with —namespace, -A, or —workload; scanned counts workloads examined.

MCP tool: k8s_audit_workloads (MCP profile: audit)

Terminal window
lookout audit workloads [flags]
FlagTypeDefaultMeaning
--cron-suspendedduration168h0m0show long a CronJob must have been suspended before it reads as forgotten rather than as maintenance in progress; it must also have skipped at least one activation, so the claim scales to the schedule
--job-suspendedduration168h0m0show long a standalone Job must have been suspended before it reads as forgotten rather than as maintenance in progress; Jobs owned by a controller or queued by Kueue are never judged
--skip-system-namespacesbool—skip system namespaces matching the active posture policy’s system_namespaces patterns
--policystring—path to a YAML posture policy file
--profilestring—built-in posture profile: default|strict|onboarding|gke-autopilot
--onlystring—comma-separated check kind or kind/reason globs to run exclusively
--skipstring—comma-separated check kind or kind/reason globs to skip
--min-severitystring—minimum finding severity to emit: info|warning|critical
--setstring—comma-separated check parameter overrides (<kind>.<param>=<val>)
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
audit.no_pdbwarningthe workload has no PodDisruptionBudget: a drain can take every replica at once
audit.pdb_posturewarninga PodDisruptionBudget overlaps another PDB on the same workload or allows zero disruptions by spec, permanently blocking voluntary node drains
audit.single_replicawarningthe workload runs a single replica, so any disruption is an outage
audit.no_readiness_probewarninga container has no readiness probe, so traffic reaches it before it can serve
audit.no_liveness_probeinfoa container has no liveness probe, so a wedged process is never restarted
audit.no_startup_probewarning, infoa container has a livenessProbe and no startupProbe, with either a liveness deadline under 60s (info) or a readinessProbe initialDelaySeconds >= 30s (warning) that shows slow startup is expected
audit.no_resource_requestswarninga container has no CPU or memory request (and no limit or namespace LimitRange to default it from), so the scheduler places it blind and node eviction ranks it first
audit.no_resource_limitswarning, infoa container has no memory or CPU limit (and no namespace LimitRange default): an unbounded memory leak OOMs the node (warning), while an unbounded CPU spike is throttled only by contention (info)
audit.no_spreadinfothe workload’s replicas are not spread across nodes or zones
audit.rigid_schedulingwarning, infoplacement constraints pin the workload to too few nodes to survive losing one
audit.hpa_cannot_scalewarning, infothe autoscaler structurally cannot scale or drops HA at idle: min equals max, the target is missing, a container has no request for its utilization target to divide by, or minReplicas is 1
audit.suspended_cronjobwarninga CronJob has been suspended past —cron-suspended and has skipped activations because of it: whatever it does is not happening, and nothing else reports that
audit.cronjob_overlap_riskwarning, infoa CronJob permits concurrent runs without an activeDeadlineSeconds bounding them to the schedule interval, or sets startingDeadlineSeconds below the controller’s 10s check loop
audit.cronjob_failingwarningan active CronJob has scheduled runs, none are currently running, and status.lastSuccessfulTime is nil — it has never succeeded
audit.suspended_jobinfoa standalone Job (no controller owner, not queued by Kueue) has been suspended past —job-suspended without finishing: the one-shot task it carries is not happening
audit.liveness_preempts_readinesswarning, infoliveness and readiness probe the same handler and liveness gives up no later than readiness: the kubelet restarts the container before readiness can take it out of the Service, so the readiness probe is decoration; info when the two deadlines tie, warning when liveness is strictly earlier
audit.rollout_drops_trafficwarninga Service-backed, multi-replica workload (or a Service-backed DaemonSet) whose serving container has no preStop hook, or a container whose preStop sleep reaches or exceeds terminationGracePeriodSeconds: SIGTERM races endpoint removal or SIGKILL arrives with zero drain time
audit.recreate_strategywarninga Service-backed, multi-replica Deployment whose strategy permits zero surviving pods — Recreate, or rollingUpdate.maxUnavailable at or above the replica count — so every rollout is an outage the Deployment never reports
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
replicasthe replica count the claim judged: the workload’s spec.replicas (nil defaults to 1, matching the API server), or the targeting HPA’s minReplicas when autoscaler is present; absent on DaemonSets, whose replica count is the node count
autoscalerthe HorizontalPodAutoscaler targeting the workload, when one does: replicas is then its minReplicas, the floor it lets the workload fall to, because spec.replicas is its current answer and would make the claim come and go with load
namespace_pdbsPodDisruptionBudgets in the workload’s namespace — 0 says the namespace has no PDB culture at all, a non-zero value says this workload was missed
overlapping_pdbother PodDisruptionBudgets in the same namespace selecting the same workload
workloadworkload(s) selected by the PodDisruptionBudget, as Kind/name
containerscontainers implicated by the finding: those missing the probe, or missing the request the autoscaler’s utilization target divides by
container_namestheir names, capped at 8 with a +N more tail
total_containerscontainers in the pod template, so containers reads as a fraction
containerthe container implicated by a per-container probe or lifecycle finding
liveness_windowthe liveness probe’s effective deadline (initialDelaySeconds + failureThreshold * periodSeconds)
period_secondsthe probe’s periodSeconds (default 10)
failure_thresholdthe probe’s failureThreshold (default 3)
initial_delay_secondsthe probe’s initialDelaySeconds
prestop_sleep_secondsseconds parsed from the container’s preStop sleep hook
termination_grace_period_secondsthe pod template’s terminationGracePeriodSeconds (default 30)
min_replicasthe HPA’s spec.minReplicas (nil defaults to 1, matching the API server)
max_replicasthe HPA’s spec.maxReplicas
metricthe utilization metric the HPA cannot compute, comma-separated if more than one
scale_targetthe HPA’s scaleTargetRef as Kind/name
eligible_nodesnodes satisfying the workload’s REQUIRED placement constraint; an upper bound, since taints and cordons are not subtracted
cluster_nodesnodes in the cluster, so eligible_nodes reads as a fraction
constraintthe label and field keys that narrow placement, sorted and capped at 8
schedulethe CronJob’s spec.schedule
concurrency_policythe CronJob’s effective spec.concurrencyPolicy (default Allow)
active_deadline_secondsthe CronJob jobTemplate’s spec.activeDeadlineSeconds, when set
starting_deadline_secondsthe CronJob’s spec.startingDeadlineSeconds
last_schedule_timethe CronJob’s status.lastScheduleTime, RFC 3339
time_zonethe CronJob’s spec.timeZone, when set
suspended_forhow long spec.suspend has been true, rounded to whole days
suspended_sincewhen the suspension is estimated to have started, RFC 3339
anchorthe evidence that estimate came from: condition (a Job’s Suspended condition), managed_field (the managedFields entry owning spec.suspend), last_schedule (CronJobs only), or creation
missed_runsactivations skipped since then; ≥N when the walk was capped, unknown when the schedule does not parse
servicesServices routing to the workload whose ports are not all scrape endpoints — the count that makes it “serving” for the rollout claims
service_namestheir names, capped at 8 with a +N more tail
termination_gracethe pod template’s terminationGracePeriodSeconds (the API default of 30s when unset), the ceiling any preStop hook would run inside
strategythe Deployment strategy setting that permits zero surviving pods: strategy.type=Recreate, or rollingUpdate.maxUnavailable=<value>
pdbssummary note: PodDisruptionBudgets seen in scope
hpassummary note: HorizontalPodAutoscalers seen in scope
nodessummary note: nodes in the cluster — the denominator every placement claim is resolved against; omitted when the node List was refused (a read.unavailable record says so, and no placement claim is made)
workloadssummary note: workloads examined, broken down as deployments/statefulsets/daemonsets/cronjobs
jobssummary note: Jobs examined for the suspension claim; they count toward scanned but not toward workloads
skipped_system_namespacessummary note: distinct system namespaces skipped under --skip-system-namespaces
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 audit workloads -A
lookout audit workloads --namespace=prod
lookout audit workloads --workload=Deployment/prod/checkout
lookout audit workloads --workload=CronJob/prod/nightly-backup
lookout audit workloads --workload=Job/prod/migrate-v42
lookout audit workloads -A --exemptions=exemptions.yaml --format=json