* feat: Add Clickhouse Support
* fix: missing case in GetCollector for ClickHouse
* chore: add analyzer
* fix; Findings
* fix: use go-version for ClickHouse version comparison
ClickHouse returns 4-part version numbers (e.g., 25.3.2.39) which
blang/semver.ParseTolerant cannot handle. Use hashicorp/go-version
(which supports arbitrary version parts) via a ClickHouse-specific
comparison function, matching the approach used by the MSSQL analyzer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* change icon
* chore: Resolve comments
- Change icon value
- Update converter to support ClickHouse
- Update loader to support ClickHouse
- Ensure IsConnected behaviour is similar to other db collectors
* fmt 🤦
* chore: Add Clickhouse case to convertAnalyzerToSpec
* resolve CollectorName comment
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
fix: correct RBAC verb and WebSocket fallback for pods/exec
This commit fixes three related issues that prevented exec collectors from
working with minimal RBAC permissions:
1. RBAC preflight check used wrong verb for pods/exec
Changed from "get" to "create" in v1beta1 and v1beta2 AccessReviewSpecs.
The pods/exec subresource requires "create" to execute commands.
2. WebSocket fallback used wrong httpstream package import
The fallback executor checked IsUpgradeFailure using the apimachinery
httpstream package, but the roundtripper creates UpgradeFailureError using
the streaming httpstream package. These are different Go types, so
errors.As always returned false and fallback to SPDY never triggered.
Changed import to k8s.io/streaming/pkg/httpstream.
3. Stdin mismatch caused SPDY fallback to hang
PodExecOptions always set Stdin:true but StreamOptions always passed
Stdin:nil. When WebSocket failed and fell back to SPDY, the server
waited for stdin data that never arrived. Changed Stdin to false in
PodExecOptions for exec, copy, and copy_from_host collectors.
* feat(analyze): warn when nodeResources has no node data, add ignoreIfNoFiles
The nodeResources analyzer previously failed silently when
cluster-resources/nodes.json was not collected (e.g. when the
clusterResources collector was excluded or could not list nodes).
It now emits a warn outcome per nodeResources entry in the spec.
Add an ignoreIfNoFiles top-level field to nodeResources, mirroring
textAnalyze, so users can opt out of the new warning when the
analyzer is intentionally optional.
- Add IgnoreIfNoFiles to v1beta2.NodeResources
- Update CRDs and JSON schemas
- Unit test the warn / ignore paths
- Add an e2e fixture and test that excludes clusterResources and
asserts the analyze output
Signed-off-by: Evans Mungai <evans@replicated.com>
* Fix review comment
Signed-off-by: Evans Mungai <evans@replicated.com>
---------
Signed-off-by: Evans Mungai <evans@replicated.com>
* feat: add host registryImages collector and analyzer
Adds a host-level registryImages collector and analyzer that can check
image existence in registries without requiring a Kubernetes cluster.
Supports inline username/password auth or ambient credentials from
~/.docker/config.json.
Refactors imageExistsWithAuth from the cluster-level registry collector
to share the core image existence check logic.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fixes from manual tests
Signed-off-by: Evans Mungai <evans@replicated.com>
* Updates from manual tests
Signed-off-by: Evans Mungai <evans@replicated.com>
* Sort template lists
Signed-off-by: Evans Mungai <evans@replicated.com>
* More changes
Signed-off-by: Evans Mungai <evans@replicated.com>
---------
Signed-off-by: Evans Mungai <evans@replicated.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat(analyze): optional additionalDeviceTypes for blockDevices; refactor match config and tests
Allow preflights to count extra lsblk TYPE values (e.g. loop, lvm) by listing them in
blockDevices.additionalDeviceTypes on BlockDevicesAnalyze. Types in this list are
eligible whether or not includeUnmountedPartitions is set; disk and optional
partitions behave as before.
Refactor matching to use blockDevicesMatchConfig and document eligibility on that
type. Add host_block_devices_match_test.go for type-rule tables and preflight-style
integration cases; keep classic scenarios in host_block_devices_test.go with a
shared analyzeHostBlockDevicesOutput helper.
Regenerate CRDs and deepcopy for the new API field.
Signed-off-by: Evans Mungai <evans@replicated.com>
* add support bundle metadata collector
* add e2e test for the new collector
* make fmt
* properly include v1beta3
* remove the ability to specify an arbitrary secret
* Add CLUSTER_RESOURCES_INGRESS_CLASS constant
* Collect IngressClass resources in cluster resources
* Add IngressClass analyzer API type
* Regenerate deepcopy for IngressClass type
* Update client-gen output from make generate
* Add IngressClass analyzer tests
* Implement IngressClass analyzer
* Register IngressClass analyzer in dispatcher
* Restore v1beta3 import in clientset scheme registration
The v1beta3 import was accidentally removed during client-gen
regeneration, causing a compile error since the SchemeBuilder
still references troubleshootv1beta3.AddToScheme.
* Uses secrets from cluster
* updated gitignore to stop ignoring needed files
* Delete specs.go.bak
* make fmt
* added preflight to generic loader
* Tells user to run in cluster if using secretKeyRef
* Update loader.go
* Update loader.go
* feat: add timestamps falg to logs collector
Kubernetes logs can be transmitted with the captured timestamps. This is useful for containers that do not log with timestamps. So I'm exposing that as a flag.
* fix: update schemas
* feat: implement collector and analyser for network namespace connectivity
checks if two network namespaces can talk to each other on udp and tcp.
its usage is as follows:
```yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: test
spec:
hostCollectors:
- networkNamespaceConnectivity:
collectorName: check-network-connectivity
fromCIDR: 10.0.0.0/24
toCIDR: 10.0.1.0/24
hostAnalyzers:
- networkNamespaceConnectivity:
collectorName: check-network-connectivity
outcomes:
- pass:
message: "Communication between 10.0.0.0/24 and 10.0.1.0/24 is working"
- fail:
message: "Communication between 10.0.0.0/24 and 10.0.1.0/24 isn't working"
```
if this fails then you may need to enable `forwarding` with:
```bash
sysctl -w net.ipv4.ip_forward=1
```
if it still fails then you may need to configure firewalld to allow the
traffic or simply disable it for sake of testing.
* chore: rebuild schemas
* chore: remove unused property
* chore: disable namespaces for other platforms
* chore: make sure we timeout temporary servers
* feat: analyzer now supports multi-node collection
* feat: check both udp and tcp even on failure
check both protocols even if one fails. this pr commit also introduces a
timeout that can be set by the user.
* feat: add templating to the failure outcome
allow users to dump the errors found during the analysis.
* chore: addressing pr comments
* feat: delete interface pair before namespace
even though the interface pair is deleted everyttime we delete the
namespace on my tests we better delete it before we delete the
namespace.
this comes out of a review comment where some people seem to still be
able to see the interface pair even after the namespace is deleted.
i.e. better safe than sorry.
* chore: fix typo on comment
* 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>
* 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 analyser
The analyser only checks PVC usage at the moment. More analysers
can be added on a need to have basis
* Add tests
* Fix flaky test by waiting for goldpinger pods to start
* Fix how outcomes get checked
* Fix catch all outcome condition
* Fix test
* feat: node metrics analyser
The analyser only checks PVC usage at the moment. More analysers
can be added on a need to have basis
* Add tests
* Fix flaky test by waiting for goldpinger pods to start
* Fix how outcomes get checked
* Fix catch all outcome condition
* Fix test
* Regenerate schemas
* Fix failing test
---------
Co-authored-by: Dexter Yan <yanshaocong@gmail.com>
* 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: 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>