Skip to content

Installation

Requirements

  • kubectl 1.20+
  • Kubernetes cluster 1.21+ (uses batch/v1, apps/v1, core/v1, events.k8s.io/v1)
  • Krew (recommended install method)

kubectl-audit is published through the codenio Krew index.

kubectl krew index add codenio https://github.com/codenio/codenio-krew-index.git
kubectl krew install codenio/audit

Index name conflict

If the name codenio is already taken in your Krew config, choose any other name for the index add step:

kubectl krew index add my-codenio https://github.com/codenio/codenio-krew-index.git
kubectl krew install my-codenio/audit
Upgrade stays the same regardless of index name:
kubectl krew upgrade audit

Krew default index

If the plugin is listed in Krew's default index:

kubectl krew install audit

From source

Requires Go 1.21+ and make.

git clone https://github.com/codenio/kubectl-audit.git
cd kubectl-audit
make install

Builds bin/audit and copies it to ~/.krew/bin/kubectl-audit. Ensure ~/.krew/bin is on your PATH.

Verify

kubectl audit --help

You should see the plugin's help output listing all subcommands.


Next: Quick Start →