Examples¶
Each subcommand has a demo manifest under examples/ that creates intentionally broken resources — so you can see the plugin in action without needing a broken cluster.
All demos¶
| Example | Subcommand | Demo folder |
|---|---|---|
| Pods | kubectl audit pods |
examples/audit-pods/ |
| Containers | kubectl audit containers |
examples/audit-containers/ |
| Jobs & CronJobs | kubectl audit jobs / cronjobs |
examples/audit-job/, audit-cronjob/ |
| Services | kubectl audit service |
examples/audit-svc/ |
| Deployments | kubectl audit deploy |
examples/audit-deploy/ |
| PV & PVC | kubectl audit pv / pvc |
examples/audit-pv/, audit-pvc/ |
| Events | kubectl audit events |
examples/audit-events/ |
| Nodes | kubectl audit nodes |
(cluster-specific, no demo) |
| Namespaces | kubectl audit ns |
examples/audit-namespace/ |
Demo pattern¶
Every demo follows this three-step pattern:
# 1. Create the broken resources
kubectl apply -f examples/audit-<target>/demo.yaml
# 2. Run the audit
kubectl audit <target> -n kubectl-audit-<target>-demo
# 3. Clean up
kubectl delete -f examples/audit-<target>/demo.yaml
Reading the output¶
Every audit prints a summary to stderr:
-------------------------------------------------------
Pod Audit summary: total = 9 benign = 3 attention = 6
-------------------------------------------------------
- total — all resources of that type found in scope
- benign — resources passing all checks
- attention — resources with at least one failing check
The table that follows lists only the attention resources. If attention = 0, there is nothing to report and no table is printed.