Troubleshooting¶
Plugin not found¶
Error:
Causes and fixes:
- Plugin not installed — run
kubectl krew install codenio/audit ~/.krew/binnot onPATH: Add this to your shell profile (~/.zshrc,~/.bashrc).- Verify the binary exists:
Empty output — nothing flagged¶
If kubectl audit pods shows attention = 0 but you expect issues:
- Your pods are actually healthy — the audit rules are conservative. Check Audit Rules for exact thresholds.
- Wrong namespace — add
-Ato check all namespaces: - Wrong context — verify you're on the right cluster:
Permission denied / Forbidden¶
Error:
You need read access to the resources being audited. See RBAC & Permissions for the minimum ClusterRole.
Quick check:
Unexpected output for containers¶
-o custom-columns not working:
The containers subcommand uses a custom printer — it does not support custom-columns, Go templates, or jsonpath. Use -o json or -o yaml for machine output, then pipe to jq.
Suspended CronJobs not appearing¶
kubectl audit cronjobs only flags CronJobs where spec.suspend = true. If your CronJob is failing (not suspended), check Jobs instead:
Service shows as healthy but traffic isn't routing¶
kubectl audit service only checks whether the Service's selector matches any Pods — it doesn't verify those Pods are Ready or actually serving traffic. After confirming the Service is matched:
kubectl audit pods -n <namespace> -l <service-selector>
kubectl audit containers -n <namespace> -l <service-selector>
Output looks different from docs¶
The plugin uses the same column widths and formats as kubectl get. Column alignment can differ depending on terminal width and the length of names in your cluster. The audit summary line is always on stderr; redirect if needed:
Filing a bug¶
If you hit an issue not covered here, open an issue at github.com/codenio/kubectl-audit/issues with:
kubectl audit --versionoutput (or binary version)kubectl versionoutput- The exact command you ran and the full error