1
1
# Reports
2
2
3
- This document contains scripts to help troubleshooting reports issues.
3
+ This document contains scripts to help troubleshoot reports issues.
4
4
5
5
## Getting reports detailed information
6
6
@@ -10,7 +10,7 @@ This will show information about the resource associated with the report.
10
10
11
11
It can be useful to determine if a particular resource kind is responsible for creating too many reports.
12
12
13
- If ` APIVERSION ` , ` KIND ` and ` SUBJECT ` is empty it means the report is orphan and it is an issue if the report is more than a couple of minutes old.
13
+ If ` APIVERSION ` , ` KIND ` and ` SUBJECT ` is empty it means the report is orphaned, and it is an issue if the report is more than a couple of minutes old.
14
14
15
15
``` console
16
16
# list cluster admission reports
@@ -37,7 +37,7 @@ NAME APIVERSION KIND
37
37
38
38
## Getting the number of reports in a cluster
39
39
40
- This will help checking if reports are incorrectly accumulating in the cluster.
40
+ This will help check if reports are incorrectly accumulating in the cluster.
41
41
42
42
``` console
43
43
COUNT=$(kubectl get cadmr --no-headers 2> /dev/null | wc -l)
65
65
66
66
## Getting the number of reports per kind
67
67
68
- Use the script below to get number of reports per resource kind in a cluster.
68
+ Use the script below to get the number of reports per resource kind in a cluster.
69
69
70
- This will help determining if a particular resource kind is responsible for creating too many reports.
70
+ This will help determine if a particular resource kind is responsible for creating too many reports.
71
71
72
72
``` console
73
73
API_LIST=$(kubectl api-resources --namespaced=false --no-headers | awk '{print $NF}')
87
87
echo "number of admission reports for $api: $COUNT"
88
88
89
89
COUNT=$(kubectl get bgscanr --no-headers -o jsonpath="{range .items[?(@.metadata.ownerReferences[0].kind=='$api')]}{.metadata.name}{'\n'}{end}" 2> /dev/null | wc -l)
90
- echo "number of background scan reports for $api: $COUNT"
90
+ echo "number of background scan reports for $api: $COUNT"
91
91
done
92
92
```
93
93
@@ -97,7 +97,7 @@ By using `--watch-only` with `kubectl` you can view report changes only without
97
97
98
98
Listing existing reports can take a long time when there is a high number of reports.
99
99
100
- With ` --watch-only ` you only get an output for reports that are created, updated or deleted.
100
+ With ` --watch-only ` you only get an output for reports that are created, updated, or deleted.
101
101
102
102
This is useful to determine if a particular resource kind is responsible for creating too many reports.
103
103
0 commit comments