Commit Graph
311 Commits
Author SHA1 Message Date
Evans Mungai ce155270c8 fix: Use correct cron job kind when discovering API versions (#1554)
* fix: Use correct cron job kind when discovering API versions

* Fix failing e2e test
2024-05-31 07:23:56 +01:00
Gerard Nguyen 80e5fac07c feat: New host collector and analyzer for Kernel Configs (#1546)
* new struct and update schemas

* implement Collect function

* add kernel config to collector struct

* generate kernel config analyzer schema

* implement kernel config analyzer

* fail on no match in pass outcome

* run make check-schemas

* fix failed unit test

* update from code review

* add selectedConfigs field

* run make check-schemas
2024-05-27 09:55:39 +10:00
Gerard Nguyen 6b368f2221 feat: [sc-103754] Be able to detect search domain misconfiguration #1391 (#1534)
* new collector dns

* implement DNS collector

* add dns service and endpoints check

* add nil check on retrieve endpoints
2024-05-01 07:04:20 +10:00
Dexter Yan f3bad5f409 fix(collector): fix helm collector with a nil error return to error list (#1535) 2024-04-29 12:19:34 +12:00
Andrew Lavery f18b5d754e update k8s imports to v0.30.0 and address changed function signature (#1528)
* update k8s imports to v0.30.0 and address changed function signature

* update schemas
2024-04-24 23:05:37 +09:00
Evans Mungai 123d17ab4a feat: node metrics collector (#1516)
* feat: node metrics collector

A collector to collect node metrics served by the API server as
per the documented API https://kubernetes.io/docs/reference/instrumentation/node-metrics/

* Update CRD schemas

* Add tests

* Remove clean from build target

* Update comments

* Commit missing tests

* Remove unnecessary log in tests
2024-04-02 14:59:55 +01:00
Gerard Nguyen 76c52d2b93 New JSON field in HTTP request collector if any (#1511)
* add new raw_json field to http collector

* add unit test
2024-03-28 17:08:51 +11:00
Gerard Nguyen 6f839b389d Quick fix to prevent panic on nil collector result (#1508)
* quick fix to prevent panic on nil collector result
* do not save pod details on error
2024-03-18 16:42:52 +11:00
Salah Al Saleh 8132936e3e Fix automated PRs manager workflow (#1489)
* Fix automated PRs manager workflow
2024-02-26 14:30:21 -08:00
Ethan Mosbaugh e24ca642aa feat: sonobuoy collector (#1469) 2024-02-16 06:56:15 -08:00
Gerard Nguyen 772d867093 update correct K8S API group for batch and policy (#1461) 2024-02-09 08:17:55 +13:00
Gerard Nguyen 5daf6d6c89 Feat: new collector run-daemonset (#1460)
* feat: new collector run-daemonset
2024-02-09 08:16:32 +13:00
Evans Mungai 2def517d39 chore: additional ceph collector commands (#1450)
* Collect text representations of the ceph data which are easier to read
* Collect ceph df command output
2024-02-06 10:04:25 +13:00
Gerard Nguyen 39b371991e feat: add timeout to run host collector (#1435)
* feat: add timeout to run host collector

* return error on invalid timeout

* return -1 on context deadline exceeded
2024-01-31 12:46:01 +00:00
Akash Shrivastava 361e12e691 feat: [ISSUE-1401]: Added helm get values option in Helm collector (#1402)
* feat: [ISSUE-1401]: Added helm get values option in Helm collector

Signed-off-by: Akash Shrivastava <akash.shrivastava@harness.io>

* Made changes in error handling

Signed-off-by: Akash Shrivastava <akash.shrivastava@harness.io>

* feat: [ISSUE-1401]: Added test cases and fixes

Signed-off-by: Akash Shrivastava <akash.shrivastava@harness.io>

* fixed test case

Signed-off-by: Akash Shrivastava <akash.shrivastava@harness.io>

---------

Signed-off-by: Akash Shrivastava <akash.shrivastava@harness.io>
2024-01-16 19:12:43 +00:00
Xav Paice e542f4fd0a bump k8s.io packages to v0.29.0 (#1419)
* bump k8s.io packages to v0.29.0

* update Go to 1.21

* update schemas
2024-01-08 17:24:41 +00:00
Evans Mungai 3012b870bd fix: flaky e2e test (#1400) 2023-12-20 16:07:30 +13:00
Evans Mungai 53113c0170 feat: goldpinger collector and analyser (#1398)
* feat: goldpinger analyser

Analyser to generate a report from goldpinger results

* Add goldpinger testdata

* Goldpinger collector

* Improvements after running tests

* More minor updates after further testing

* Better error message if a container fails to start

* A few more updates

* Add goldpinger e2e test

* Update schemas

* Clean up help installs in e2e tests

* Add resource limits to goldpinger pods

* Some minor improvements

* Some more changes noted when writing docs

* Update schemas

* A few more updates when testing with kURL

* Log goldpinger tests

* Tests before exit code
2023-12-12 11:02:41 +00:00
Evans Mungai d4623d9404 fix(collector): Let pgx library parse TLS parameters (#1390)
* fix(collector): Let pgx library parse TLS parameters

This allows the collector to respect the sslmode parameters

Fix: #1163

* Add comment

* Improve postgres collector test
2023-11-16 12:51:43 +00:00
Weiyanli Chen(York)andEvans Mungai bc4856869e fix: missing omitempty on 2 of the new fields (#1389)
* fix: missing omitempty on 2 of the new fields

* fix: Rename TS_WORKSPACE_DIR to TS_OUTPUT_DIR

---------

Co-authored-by: Evans Mungai <evans@replicated.com>
2023-11-09 13:25:11 +00:00
Weiyanli Chen(York)andEvans Mungai f6373f3e36 feat: save host run file output (#1376)
* feat: save cmd run output

* chore: schema changes

* chore: example hostCollector

* chore: add log messages to key actions

* fix: correctly inherit all parent env by default

* chore: do not save input file

the user invokes the input already got the input but those content could be sensitive to another user who received this bundle

* test: unit test for host run

* revert: "chore: do not save input file"

This reverts commit 6af77ad1ce.

that commit is wrong

* chore: fix log msg and example yaml

* Ensure child cmd runs in its own working dir

* Check filename for slashes not content

* Update logging

* Add using relative path files as commands

---------

Co-authored-by: Evans Mungai <evans@replicated.com>
2023-11-08 13:49:46 +00:00
Evans Mungai 73a2d882d7 fix: Store custom resources in JSON & YAML format (#1360)
fix: Store custom resources as JSON and YAML files
2023-10-10 17:50:15 +01:00
Xav Paice cc56522571 feat: add ceph df to ceph collector (#1358) 2023-10-09 16:53:20 +13:00
ada mancini e3adc1cb35 call out to fio for host filesystem performance (#1275)
* stashing changes

* split filesystem collector into fio and legacy functions

* read fio results into analyzer

* remove test script

* update go.mod

* remove old notes

* go mod tidy

* fix up go.mod

* fix up go.mod

* refactor tests for fio

* make schemas

* remove local scripts

* local watch script for building troubleshoot

* document watch script

* fix var names

* handle errors if run as non-root

* go mod tidy

* use String interface

* collector happy path test

* invalid filesize

* invalid filesize

* tests

* remove old code

* remove old init function

* let actions tests run this

* clean up tests

* go mod tidy

* remove duplicated type declaration

* remove old file create code
2023-10-03 14:21:56 -04:00
Evans Mungai 86279b4ec4 chore(redactors): memory consumption improvements (#1332)
* Document additional go tool profiling flags

* Add a regex cache to avoid compiling regular expressions all the time

* Reduce max buffer capacity

* Prefer bytes to strings

Strings are immutable and hence we need to create a new one
all the time when operation on them

* Some more changes

* More bytes

* Use writer.Write instead of fmt.FPrintf

* Clear regex cache when resetting redactors

* Logs errors when redactors error since they get swallowed

* Add an improvement comment

* Limit the number of goroutines spawned when redacting

* Minor improvement

* Write byte slices one at a time instead of concatenating them first

* Add a test for writeBytes

* Additional tests
2023-09-15 13:09:21 -04:00
Evans Mungai 514c86d891 fix: use duration strings for http collector timeout (#1338)
* fix: use duration strings for http collector timeout

This follows the same format that all other collectors use.

* Update from PR comment
2023-09-13 19:18:03 -04:00
Archit Sharma 24c6278e5d add http collector timeouts; fixes #1064 (#1310)
* feat(collector): add http method timeouts (#1064)

Signed-off-by: Archit Sharma <archit@replicated.com>

* feat(collector) add schema updates for the http timeout (#1064)

Signed-off-by: Archit Sharma <archit@replicated.com>

* feat(collector): refactor HTTP method calls (#1064)

Signed-off-by: Archit Sharma <archit@replicated.com>

* feat(collector): add tests for HTTP type collector (#1064)

Signed-off-by: Archit Sharma <archit@replicated.com>

---------

Signed-off-by: Archit Sharma <archit@replicated.com>
2023-09-01 19:08:22 +05:30
Dexter Yan b7d5a9876c feat(collector): add helm collector (#1309) 2023-08-28 11:51:57 +12:00
Evans Mungai 96c482a1f5 fix: complete mssql analyser implementation (#1290)
* fix: complete mssql analyser implementation

* Add mssql analyser tests and mssql collector logs

* Close mssql db after collecting data
2023-08-25 10:38:39 +01:00
Dexter Yan d730be0fae feat(redact): use a scan regex for default redact rule of lines to improve cpu usage and reduce time cost (#1291) 2023-08-25 15:11:04 +12:00
Dexter Yan 17cbc16e05 feat(support-bundler): add leases, configmaps, service accounts and volume attachments for cluster resources collector (#1266) 2023-08-14 18:14:38 +12:00
Dexter Yan 5bb4358f7a Fix(support-bundle): improve copy from host collector performance by checking daemonset pod FailedMount event and retry (#1281) 2023-08-09 22:32:14 +12:00
Pavan Sokke Nagaraj 39314ef200 chore: export error ErrInsufficientPermissionsToRun and func ShowTextResultsStructured (#1297)
* chore: move ErrInsufficientPermissions to collect

* chore: export func ShowTextResultsStructured

* chore: rename to ErrInsufficientPermissionsToRun
2023-08-08 14:17:15 -04:00
Dexter Yan 531edf42e2 feat(support-bundle): add host certificate collector and analyzer (#1132) 2023-07-17 17:05:05 +12:00
Martin Hrabovcin 24822b7f95 fix(collector): cluster-resources PV filename pattern (#1262) 2023-07-10 12:53:56 -04:00
ada mancini 58c428347e get cluster-resources even if negotiating RBAC fails (#1243)
* log errors negotiating and set ignoreRBAC when authorizer webhooks would fail
2023-06-27 15:07:08 +12:00
Dexter Yan fefe118943 feat(collector): checking existing service account before create running pod (#1222) 2023-06-15 15:39:18 +12:00
Dexter Yan 5b1e48258f fix(collector): solving pod stuck in terminating with CNI issue (#1196)
* feat(collector): add force delete for pods when they're done with in a collector
2023-06-15 13:59:59 +12:00
ada manciniandDiamon Wiggins 03c53cabd6 make ConfigMap collector namespace-optional (#1212)
* try to load default namespace from kubectl current context

* use  ns from kubectl context when no ns is given in the spec

* remove test prints

* Update pkg/collect/configmap.go

Co-authored-by: Diamon Wiggins <38189728+diamonwiggins@users.noreply.github.com>

---------

Co-authored-by: Diamon Wiggins <38189728+diamonwiggins@users.noreply.github.com>
2023-06-13 13:12:17 -04:00
David Rohnow a5628874b0 Add code to collect cluster endpoint data with cluster-resources collector (#1219)
added code to collect cluster endpoint data to cluster-resources collector
2023-06-13 16:33:52 +12:00
Ahmed Mousa 620fa75eb5 feat: add k8s custom metrics collector (#1174)
Collector that collects custom k8s metrics from custom.metrics.k8s.io/v1beta1/ and saves them in the bundle under the /metrics directory
2023-06-09 10:26:03 +01:00
David Rohnow 60d5b686cc Add Daemonset collection to cluster_resources (#1213)
* added daemonset collection to cluster_resources

* squash commit to remove commit that was submitted by root
2023-06-08 16:05:54 -07:00
Evans Mungai 401dfe2c57 feat: add loader APIs to load specs from raw troubleshoot spec (#1202)
* feat: add loader APIs to load specs from a list of yaml docs

The change introduces a loader package that will contain loader
public APIs. The aim of these APIs will be to, given any source of
troubleshoot specs, the loaders will fetch the specs and parse out
all troubleshoot objects that can be extracted.

* Some refactoring

* Some more changes

* More changes caught when testing vendor portal

* Add tests and rename Troubleshoot kinds struct

* Additional test

* Handle ConfigMap and Secrets with multiple specs in them

* Fix failing test

* Revert multidoc split implementation

* Fix merge conflict

* Change LoadFromXXX functions to a single LoadSpecs function
2023-06-06 16:48:29 -04:00
Dexter Yan 2b8e3fb6bb fix(collector): removed unused name in certificates collector (#1200) 2023-06-01 09:46:34 +01:00
Dexter Yan acb1099bda feat(analyzer): add certificate analyzer (#1128)
* feat(analyzer): add cert analyzer
* feat(analyzer): add certificates tests
2023-05-29 16:40:10 +12:00
Diamon WigginsandEvans Mungai 091c4dc134 Capture runPod status and events before deleting the pod (#1172)
* adding savepoddetails function to capture runpod describe output
* update output paths for static-hi.log

---------

Co-authored-by: Evans Mungai <evans@replicated.com>
2023-05-29 10:37:27 +12:00
Martin Hrabovcin 51f626b994 fix(collector): cluster resource file names (#1165)
* fix(collector): use correct path for custom resources

* fix(collector): cluster role resource names
2023-05-23 10:11:45 +01:00
Martin Hrabovcin e22c7d7eca feat(collector): add priority class resources (#1159)
* feat(collector): add priority classes resources

* chore: use priorityclasses filename
2023-05-18 12:21:06 +01:00
Ethan Mosbaugh af4cc8a08a fix: simplify logs collector by removing goroutine which had a concurrency bug (#1155)
* fix: logs collector timeout prevent concurrent map iteration and map write

* remove goroutine

* log pod logs timeout
2023-05-18 07:43:47 +01:00
Dexter Yan 2484b3b1eb feat(certificate): support array of certificates from configmaps and secrets (#1119)
feat(certificate): support array of certificates from configmaps and secrets
2023-04-26 12:07:32 +12:00