Skip to content

Commit

Permalink
docs: locally run with a specific ServiceAccount
Browse files Browse the repository at this point in the history
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
  • Loading branch information
viccuad committed Jul 24, 2023
1 parent 12810e1 commit 591c154
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PolicyReports CRDs. And the audit feature is disabled by default.

Then:

``` console
```console
kubectl port-forward -n kubewarden service/policy-server-default 3000:8443

./bin/audit-scanner \
Expand All @@ -16,9 +16,34 @@ kubectl port-forward -n kubewarden service/policy-server-default 3000:8443

or to get results in JSON:

``` console
```console
./bin/audit-scanner \
-k kubewarden --namespace default \
--policy-server-url https://localhost:3000 \
-l debug --print
```

### Run against audit-scanner SA

To run with the `audit-scanner` ServiceAccount, install `kubewarden-controller`
chart, and, with the help of the kubectl [view-serviceaccount-kubeconfig](https://github.com/superbrothers/kubectl-view-serviceaccount-kubeconfig-plugin)
plugin:

```console
kubectl create token audit-scanner -n kubewarden | kubectl view-serviceaccount-kubeconfig > ./kubeconfig
```

If needed, patch the resulting kubeconfig, adding the missing
`certificate-authority`. E.g:

```yaml
clusters:
- cluster:
certificate-authority: /home/vic/.minikube/ca.crt
```
And use it:
```console
export KUBECONFIG=./kubeconfig
```

0 comments on commit 591c154

Please sign in to comment.