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)
lookout audit workloads [flags]| Flag | Type | Default | Meaning |
|---|---|---|---|
--cron-suspended | duration | 168h0m0s | how 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-suspended | duration | 168h0m0s | how 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-namespaces | bool | — | skip system namespaces matching the active posture policy’s system_namespaces patterns |
--policy | string | — | path to a YAML posture policy file |
--profile | string | — | built-in posture profile: default|strict|onboarding|gke-autopilot |
--only | string | — | comma-separated check kind or kind/reason globs to run exclusively |
--skip | string | — | comma-separated check kind or kind/reason globs to skip |
--min-severity | string | — | minimum finding severity to emit: info|warning|critical |
--set | string | — | comma-separated check parameter overrides (<kind>.<param>=<val>) |
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 |
|---|---|---|
audit.no_pdb | warning | the workload has no PodDisruptionBudget: a drain can take every replica at once |
audit.pdb_posture | warning | a PodDisruptionBudget overlaps another PDB on the same workload or allows zero disruptions by spec, permanently blocking voluntary node drains |
audit.single_replica | warning | the workload runs a single replica, so any disruption is an outage |
audit.no_readiness_probe | warning | a container has no readiness probe, so traffic reaches it before it can serve |
audit.no_liveness_probe | info | a container has no liveness probe, so a wedged process is never restarted |
audit.no_startup_probe | warning, info | a 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_requests | warning | a 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_limits | warning, info | a 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_spread | info | the workload’s replicas are not spread across nodes or zones |
audit.rigid_scheduling | warning, info | placement constraints pin the workload to too few nodes to survive losing one |
audit.hpa_cannot_scale | warning, info | the 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_cronjob | warning | a 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_risk | warning, info | a 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_failing | warning | an active CronJob has scheduled runs, none are currently running, and status.lastSuccessfulTime is nil — it has never succeeded |
audit.suspended_job | info | a 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_readiness | warning, info | liveness 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_traffic | warning | a 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_strategy | warning | a 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.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 |
|---|---|
replicas | the 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 |
autoscaler | the 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_pdbs | PodDisruptionBudgets 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_pdb | other PodDisruptionBudgets in the same namespace selecting the same workload |
workload | workload(s) selected by the PodDisruptionBudget, as Kind/name |
containers | containers implicated by the finding: those missing the probe, or missing the request the autoscaler’s utilization target divides by |
container_names | their names, capped at 8 with a +N more tail |
total_containers | containers in the pod template, so containers reads as a fraction |
container | the container implicated by a per-container probe or lifecycle finding |
liveness_window | the liveness probe’s effective deadline (initialDelaySeconds + failureThreshold * periodSeconds) |
period_seconds | the probe’s periodSeconds (default 10) |
failure_threshold | the probe’s failureThreshold (default 3) |
initial_delay_seconds | the probe’s initialDelaySeconds |
prestop_sleep_seconds | seconds parsed from the container’s preStop sleep hook |
termination_grace_period_seconds | the pod template’s terminationGracePeriodSeconds (default 30) |
min_replicas | the HPA’s spec.minReplicas (nil defaults to 1, matching the API server) |
max_replicas | the HPA’s spec.maxReplicas |
metric | the utilization metric the HPA cannot compute, comma-separated if more than one |
scale_target | the HPA’s scaleTargetRef as Kind/name |
eligible_nodes | nodes satisfying the workload’s REQUIRED placement constraint; an upper bound, since taints and cordons are not subtracted |
cluster_nodes | nodes in the cluster, so eligible_nodes reads as a fraction |
constraint | the label and field keys that narrow placement, sorted and capped at 8 |
schedule | the CronJob’s spec.schedule |
concurrency_policy | the CronJob’s effective spec.concurrencyPolicy (default Allow) |
active_deadline_seconds | the CronJob jobTemplate’s spec.activeDeadlineSeconds, when set |
starting_deadline_seconds | the CronJob’s spec.startingDeadlineSeconds |
last_schedule_time | the CronJob’s status.lastScheduleTime, RFC 3339 |
time_zone | the CronJob’s spec.timeZone, when set |
suspended_for | how long spec.suspend has been true, rounded to whole days |
suspended_since | when the suspension is estimated to have started, RFC 3339 |
anchor | the 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_runs | activations skipped since then; ≥N when the walk was capped, unknown when the schedule does not parse |
services | Services routing to the workload whose ports are not all scrape endpoints — the count that makes it “serving” for the rollout claims |
service_names | their names, capped at 8 with a +N more tail |
termination_grace | the pod template’s terminationGracePeriodSeconds (the API default of 30s when unset), the ceiling any preStop hook would run inside |
strategy | the Deployment strategy setting that permits zero surviving pods: strategy.type=Recreate, or rollingUpdate.maxUnavailable=<value> |
pdbs | summary note: PodDisruptionBudgets seen in scope |
hpas | summary note: HorizontalPodAutoscalers seen in scope |
nodes | summary 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) |
workloads | summary note: workloads examined, broken down as deployments/statefulsets/daemonsets/cronjobs |
jobs | summary note: Jobs examined for the suspension claim; they count toward scanned but not toward workloads |
skipped_system_namespaces | summary note: distinct system namespaces skipped under --skip-system-namespaces |
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 audit workloads -Alookout audit workloads --namespace=prodlookout audit workloads --workload=Deployment/prod/checkoutlookout audit workloads --workload=CronJob/prod/nightly-backuplookout audit workloads --workload=Job/prod/migrate-v42lookout audit workloads -A --exemptions=exemptions.yaml --format=json