1
1
# Insights Operator
2
2
3
- This cluster operator gathers anonymized system configuration and reports it to Red Hat Insights. It is a part of the
4
- standard OpenShift distribution. The data collected allows for debugging in the event of cluster failures or
3
+ This cluster operator gathers anonymized system configuration and reports it to Red Hat Insights. It is a part of the
4
+ standard OpenShift distribution. The data collected allows for debugging in the event of cluster failures or
5
5
unanticipated errors.
6
6
7
7
# Table of Contents
@@ -12,26 +12,27 @@ unanticipated errors.
12
12
- [ Testing] ( #testing )
13
13
- [ Documentation] ( #documentation )
14
14
- [ Getting metrics from Prometheus] ( #getting-metrics-from-prometheus )
15
- - [ Generate the certificate and key] ( #generate-the-certificate-and-key )
16
- - [ Prometheus metrics provided by Insights Operator] ( #prometheus-metrics-provided-by-insights-operator )
17
- - [ Running IO locally] ( #running-io-locally )
18
- - [ Running IO on K8s] ( #running-io-on-k8s )
19
- - [ Getting the data directly from Prometheus] ( #getting-the-data-directly-from-prometheus )
20
- - [ Debugging Prometheus metrics without valid CA] ( #debugging-prometheus-metrics-without-valid-ca )
15
+ - [ Generate the certificate and key] ( #generate-the-certificate-and-key )
16
+ - [ Prometheus metrics provided by Insights Operator] ( #prometheus-metrics-provided-by-insights-operator )
17
+ - [ Running IO locally] ( #running-io-locally )
18
+ - [ Running IO on K8s] ( #running-io-on-k8s )
19
+ - [ Getting the data directly from Prometheus] ( #getting-the-data-directly-from-prometheus )
20
+ - [ Debugging Prometheus metrics without valid CA] ( #debugging-prometheus-metrics-without-valid-ca )
21
21
- [ Debugging] ( #debugging )
22
- - [ Using the profiler] ( #using-the-profiler )
23
- - [ Starting IO with the profiler] ( #starting-io-with-the-profiler )
24
- - [ Collect profiling data] ( #collect-profiling-data )
25
- - [ Analyzing profiling data] ( #analyzing-profiling-data )
22
+ - [ Using the profiler] ( #using-the-profiler )
23
+ - [ Starting IO with the profiler] ( #starting-io-with-the-profiler )
24
+ - [ Collect profiling data] ( #collect-profiling-data )
25
+ - [ Analyzing profiling data] ( #analyzing-profiling-data )
26
26
- [ Changelog] ( #changelog )
27
- - [ Updating the changelog] ( #updating-the-changelog )
27
+ - [ Updating the changelog] ( #updating-the-changelog )
28
28
- [ Reported data] ( #reported-data )
29
- - [ Insights Operator Archive] ( #insights-operator-archive )
30
- - [ Sample IO archive] ( #sample-io-archive )
31
- - [ Generating a sample archive] ( #generating-a-sample-archive )
32
- - [ Formatting archive json files] ( #formatting-archive-json-files )
33
- - [ Obfuscating an archive] ( #obfuscating-an-archive )
34
- - [ Updating the sample archive] ( #updating-the-sample-archive )
29
+ - [ Insights Operator Archive] ( #insights-operator-archive )
30
+ - [ Sample IO archive] ( #sample-io-archive )
31
+ - [ Generating a sample archive] ( #generating-a-sample-archive )
32
+ - [ Formatting archive json files] ( #formatting-archive-json-files )
33
+ - [ Obfuscating an archive] ( #obfuscating-an-archive )
34
+ - [ Updating the sample archive] ( #updating-the-sample-archive )
35
+ - [ Conditional Gathering] ( #conditional-gathering )
35
36
- [ Contributing] ( #contributing )
36
37
- [ Support] ( #support )
37
38
- [ License] ( #license )
@@ -60,7 +61,7 @@ Unit tests can be started by the following command:
60
61
make test
61
62
```
62
63
63
- It is also possible to specify CLI options for Go test. For example, if you need to disable test results caching,
64
+ It is also possible to specify CLI options for Go test. For example, if you need to disable test results caching,
64
65
use the following command:
65
66
66
67
``` shell script
@@ -72,8 +73,8 @@ VERBOSE=-count=1 make test
72
73
# Documentation
73
74
74
75
75
- The document [ docs/gathered-data] ( docs/gathered-data.md ) contains the list of collected data and the API that is used
76
- to collect it. This documentation is generated by the command bellow, by collecting the comment tags located above
76
+ The document [ docs/gathered-data] ( docs/gathered-data.md ) contains the list of collected data and the API that is used
77
+ to collect it. This documentation is generated by the command bellow, by collecting the comment tags located above
77
78
each Gather method.
78
79
79
80
To start generating the document run:
@@ -86,12 +87,12 @@ make docs
86
87
87
88
## Generate the certificate and key
88
89
89
- Certificate and key are required to access Prometheus metrics (instead 404 Forbidden is returned). It is possible
90
- to generate these two files from Kubernetes config file. Certificate is stored in ` users/admin/client-cerfificate-data `
91
- and key in ` users/admin/client-key-data ` . Please note that these values are encoded by using Base64 encoding,
90
+ Certificate and key are required to access Prometheus metrics (instead 404 Forbidden is returned). It is possible
91
+ to generate these two files from Kubernetes config file. Certificate is stored in ` users/admin/client-cerfificate-data `
92
+ and key in ` users/admin/client-key-data ` . Please note that these values are encoded by using Base64 encoding,
92
93
so it is needed to decode them, for example by ` base64 -d ` .
93
94
94
- There's a tool named ` gen_cert_key.py ` that can be used to automatically generate both files. It is stored in ` tools `
95
+ There's a tool named ` gen_cert_key.py ` that can be used to automatically generate both files. It is stored in ` tools `
95
96
subdirectory.
96
97
97
98
``` shell script
@@ -100,10 +101,10 @@ gen_cert_file.py kubeconfig.yaml
100
101
101
102
## Prometheus metrics provided by Insights Operator
102
103
103
- It is possible to read Prometheus metrics provided by Insights Operator. Example of metrics exposed by
104
+ It is possible to read Prometheus metrics provided by Insights Operator. Example of metrics exposed by
104
105
Insights Operator can be found at [ metrics.txt] ( docs/metrics.txt )
105
106
106
- Depending on how or where the IO is running you may have different ways to retrieve the metrics.
107
+ Depending on how or where the IO is running you may have different ways to retrieve the metrics.
107
108
Here is a list of some options, so you can find the one that fits you:
108
109
109
110
### Running IO locally
@@ -185,7 +186,7 @@ go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
185
186
go tool pprof http://localhost:6060/debug/pprof/heap
186
187
```
187
188
188
- These commands will create a compressed file that can be visualized using a variety of tools, one of them is
189
+ These commands will create a compressed file that can be visualized using a variety of tools, one of them is
189
190
the ` pprof ` tool.
190
191
191
192
### Analyzing profiling data
@@ -213,7 +214,7 @@ It uses both the local git and GitHub`s API to update the file so:
213
214
214
215
It can be used 2 ways:
215
216
216
- 1 . Providing no command line arguments the script will update the current ` CHANGELOG.md ` with the latest changes
217
+ 1 . Providing no command line arguments the script will update the current ` CHANGELOG.md ` with the latest changes
217
218
2 . according to the local git state.
218
219
219
220
> 🚨 IMPORTANT: It will only work with changelogs created with this script
@@ -222,7 +223,7 @@ It can be used 2 ways:
222
223
go run cmd/changelog/main.go
223
224
```
224
225
225
- 2 . Providing 2 command line arguments, ` AFTER ` and ` UNTIL ` dates the script will generate a new ` CHANGELOG.md ` within
226
+ 2 . Providing 2 command line arguments, ` AFTER ` and ` UNTIL ` dates the script will generate a new ` CHANGELOG.md ` within
226
227
the provided time frame.
227
228
228
229
``` shell script
@@ -235,17 +236,17 @@ go run cmd/changelog/main.go 2021-01-10 2021-01-20
235
236
* ClusterOperator objects
236
237
* All non-secret global config (hostnames and URLs anonymized)
237
238
238
- The list of all collected data with description, location in produced archive and link to Api and some examples is
239
+ The list of all collected data with description, location in produced archive and link to Api and some examples is
239
240
at [ docs/gathered-data.md] ( docs/gathered-data.md )
240
241
241
- The resulting data is packed in ` .tar.gz ` archive with folder structure indicated in the document. Example of such
242
+ The resulting data is packed in ` .tar.gz ` archive with folder structure indicated in the document. Example of such
242
243
archive is at [ docs/insights-archive-sample] ( docs/insights-archive-sample ) .
243
244
244
245
## Insights Operator Archive
245
246
246
247
### Sample IO archive
247
248
248
- There is a sample IO archive maintained in this repo to use as a quick reference. (can be found
249
+ There is a sample IO archive maintained in this repo to use as a quick reference. (can be found
249
250
at [ docs/insights-archive-sample] ( https://github.com/openshift/insights-operator/tree/master/docs/insights-archive-sample ) )
250
251
251
252
To keep it up-to-date it is ** required** to update this manually when developing a new data enhancement.
@@ -311,8 +312,18 @@ the `managedFields` field when it was removed from the IO archive to save space:
311
312
./scripts/update_sample_archive.sh < Path of directory with the NEW extracted IO archive> ' "managedFields":'
312
313
```
313
314
314
- The path of the sample archive directory should be constant relative to
315
- the path of the script and therefore does not have to be specified explicitly.
315
+ The path of the sample archive directory should be constant relative to the path of the script and therefore does not
316
+ have to be specified explicitly.
317
+
318
+ # Conditional Gathering
319
+
320
+ Conditional Gatherer fetches its config from remote URL which is set in the config, the default one for local
321
+ development is set to ` http://localhost:8000/ ` . You can start a mock server following the next steps:
322
+
323
+ - ` git clone https://github.com/RedHatInsights/insights-operator-gathering-conditions.git `
324
+ - ` cd insights-operator-gathering-conditions/ `
325
+ - ` ./build.sh `
326
+ - ` python3 -m http.server --directory build/ `
316
327
317
328
# Contributing
318
329
0 commit comments