forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RHOAIENG-15772: tests(odh-nbc): write auditlogs from envtest tests to…
… disk upon request (#451) * RHOAIENG-15772: tests(odh-nbc): write auditlogs from envtest tests to disk upon request This helps with debugging because it's then possible to do e.g. ``` cat /tmp/audit.log | jq | ... ``` and investigate what happened when a test was running. * fixup logging and order and few comments * fixup readme and tweaks
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
components/odh-notebook-controller/envtest-audit-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/#audit-policy | ||
# This is extremely verbose kube-apiserver logging that may be enabled for debugging of envtest-based tests | ||
--- | ||
apiVersion: audit.k8s.io/v1 | ||
kind: Policy | ||
rules: | ||
# Log all requests in `developer` namespace at the RequestResponse (maximum verbosity) level. | ||
- level: RequestResponse | ||
namespaces: ["developer"] | ||
|
||
# Use jq to analyze the log file this produces. For example: | ||
|
||
# jq 'select((.objectRef.apiGroup == "dscinitialization.opendatahub.io" | ||
# or .objectRef.apiGroup == "datasciencecluster.opendatahub.io") | ||
# and .user.username != "system:serviceaccount:redhat-ods-operator:redhat-ods-operator-controller-manager" | ||
# and .verb != "get" and .verb != "watch" and .verb != "list")' < /tmp/kube-apiserver-audit.log |