* add a TLS parameter for cacert
* pass a ca cert into http request
* test preflight
* make schemas
* log extra information from http request
* pass a proxy into the collector spec
* hitting a segfault; breakpoint
* accept a dir, file, or a string-literal as CA
* move tls params into get, put, post methods
* test for cert untrusted response
* make generate
* make schemas
* more test cases
* make schemas
* dont include system certs
* make generate && make schemas
* resolve gosec G402 warning
* remove old check for system certs
* ignore errcheck "return value not checked" linter errors
* Add image parameter to the goldpinger collector
* Pass image directly as a function arg
Also allow util image to be set in spec
* Remove pointless util image override
* Update pkg/collect/goldpinger.go
Co-authored-by: Evans Mungai <evans@replicated.com>
* Simplify image override
---------
Co-authored-by: Evans Mungai <evans@replicated.com>
allows troubleshoot to collect and analyze CPU micro architecture. this
is an usage example:
```yaml
apiVersion: troubleshoot.sh/v1beta2
kind: HostPreflight
metadata:
name: ec-cluster-preflight
spec:
collectors:
- cpu: {}
analyzers:
- cpu:
checkName: CPU
outcomes:
- pass:
when: 'supports x86-64-v2'
message: CPU supports x86-64-v2
- fail:
message: CPU does not support x86-64-v2
```
* feat: Install goldpinger if one does not exist when running goldpinger collector
- Deploy golpinger daemonset if one is not detected in the cluster
- Clean up all deployed resources
- Add delay to allow users to wait for goldpinger to perform checks
Signed-off-by: Evans Mungai <evans@replicated.com>
* Add missing test data file
Signed-off-by: Evans Mungai <evans@replicated.com>
* Better naming of create resource functions
Signed-off-by: Evans Mungai <evans@replicated.com>
---------
Signed-off-by: Evans Mungai <evans@replicated.com>
* add struct for host dns collector
* add miekg/dns
* add more logs
* nit
* new field names
* use Hostnames instead of Names
* misc update
* make schemas
* no error when there is no resolv.conf
* query all searches
* add summary.json file
* merge summary into result file
* query AAAA and CNAME as well
* update schema for hostnames to be required
* store DNS collector in JSON output for analyze later
* fix incorrect path
* configurable dns image
* make non resolvable domain configurable
* nit update address field
* * update dns util image
* add unit test
* new schema for etcd collector
* add placeholder
* wip
* get supported distribution
* add exec implementation
* wait for etcd pod to be ready
* misc
* update k0s etcd certs path
* fix unit tests
* address code reviews
* update from code review
* add etcdctl version
Linux control groups host collector that detects whether the specified mountPoint is a cgroup filesystem and what version it is. The collector also collects information of the configured cgroup controllers.
Signed-off-by: Evans Mungai <evans@replicated.com>
* 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
* 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
* 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
* 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
* 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>
* 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>
* 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
* 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