48 Commits

Author SHA1 Message Date
Andrew Reed
7b36e6a1f8 Copy in longhorn client (#454) 2021-10-22 15:24:07 -05:00
Simon Croome
977fc438ea Remote host collectors (#392)
* Add collect command and remote host collectors

Adds the ability to run a host collector on a set of remote k8s nodes.
Target nodes can be filtered using the --selector flag, with the same
syntax as kubectl.  Existing flags for --collector-image,
--collector-pullpolicy and --request-timeout are used.  To run on a
specified node, --selector="kubernetes.io/hostname=kind-worker2" could
be used.

The collect command is used by the remote collector to output the
results using a "raw" format, which uses the filename as the key, and
the value the output as a escaped json string.  When run manually it
defaults to fully decoded json. The existing block devices,
ipv4interfaces and services host collectors don't decode properly - the
fix is to convert their slice output to a map (fix not included as
unsure what depends on the existing format).

The collect command is also useful for troubleshooting preflight issues.

Examples are included to show remote collector usage.

```
bin/collect --collector-image=croomes/troubleshoot:latest  examples/collect/remote/memory.yaml --namespace test
{
  "kind-control-plane": {
    "system/memory.json": {
      "total": 1304207360
    }
  },
  "kind-worker": {
    "system/memory.json": {
      "total": 1695780864
    }
  },
  "kind-worker2": {
    "system/memory.json": {
      "total": 1726353408
    }
  }
}
```

The preflight command has been updated to run remote collectors.  To run
a host collector remotely it must be specified in the spec as a
`remoteCollector`:

```
apiVersion: troubleshoot.sh/v1beta2
kind: HostPreflight
metadata:
  name: memory
spec:
  remoteCollectors:
    - memory:
        collectorName: memory
  analyzers:
    - memory:
        outcomes:
          - fail:
              when: "< 8Gi"
              message: At least 8Gi of memory is required
          - warn:
              when: "< 32Gi"
              message: At least 32Gi of memory is recommended
          - pass:
              message: The system has as sufficient memory
```

Results for each node are analyzed separately, with the node name
appended to the title:

```
bin/preflight --interactive=false --collector-image=croomes/troubleshoot:latest examples/preflight/remote/memory.yaml --format=json
{memory running 0 1}
{memory completed 1 1}
{
  "fail": [
    {
      "title": "Amount of Memory (kind-worker2)",
      "message": "At least 8Gi of memory is required"
    },
    {
      "title": "Amount of Memory (kind-worker)",
      "message": "At least 8Gi of memory is required"
    },
    {
      "title": "Amount of Memory (kind-control-plane)",
      "message": "At least 8Gi of memory is required"
    }
  ]
}
```

Also added a host collector to allow preflight checks of required kernel
modules, which is the main driver for this change.
2021-10-06 09:03:53 -05:00
Salah Aldeen Al Saleh
1bdd3db8c5 update schemas (#428)
* update schemas

* update controller-gen
2021-09-23 11:03:19 -07:00
John Murphy
639bf7a832 Add signed SBOM to troubleshoot (#414)
This change will generate a signed software bill of materials and add it to the repository release archives when the project is released.
2021-09-21 13:55:41 -05:00
Salah Aldeen Al Saleh
ac2a0484e2 add build flags to ffi (#349) 2021-04-12 11:23:46 -07:00
divolgin
7a0c6e5383 use containers package instead of go-containerregistry 2021-04-11 21:39:44 +00:00
Marc Campbell
c7fdec0291 Removing Scopeagent 2021-01-28 18:22:48 +00:00
divolgin
9e669b3f13 Remove RRD dependency and switch to dynamic linking 2020-11-12 19:13:25 +00:00
divolgin
5a1321da02 Collector and analyzer for RRD data 2020-11-10 17:19:17 +00:00
divolgin
a0ce85ae1e Adding troubleshoot.sh/v1beta2 2020-09-01 19:57:11 +00:00
Andrew Lavery
407b80daf5 update controller-gen to v0.3.0
the first version to be k8s 1.18 compatible
2020-08-10 17:51:53 -04:00
GraysonNull
dc80733397 update sample preflight and support bundles, update diretory name 2020-07-13 15:43:10 +00:00
Marc Campbell
a22e2e25df Analyze from the CLI 2020-06-12 12:47:45 -07:00
Marc Campbell
65f957db81 Refactor to support K8s 1.18 2020-06-12 09:28:49 -07:00
Andrew Lavery
c262320cea fix build after k8s 1.18 was released 2020-03-26 18:50:23 +00:00
Marc Campbell
206e5c01d7 Fix makefile 2020-03-23 08:37:53 -07:00
Marc Campbell
562a565f1f Adding postgres analyzer 2020-03-19 18:28:13 -07:00
Marc Campbell
346c751bdf Merge pull request #134 from replicatedhq/openapischema
Generate OpenAPISchema
2020-03-05 13:42:21 -08:00
Frank Shotwell
1b9a220e2d set SCOPE_LOG_ROOT_PATH to /dev/null to avoid creating lots of logfiles 2020-02-21 19:34:26 +00:00
Marc Campbell
899d5d7672 Generate OpenAPISchema 2020-02-10 21:17:11 +00:00
Marc Campbell
0aafbb79a6 go mod! 2019-12-24 20:00:46 +00:00
Marc Campbell
0ad7a87e4d Bump makefile 2019-12-24 19:46:43 +00:00
Marc Campbell
3955dab9bc Removing the CRD 2019-12-24 19:26:26 +00:00
Marc Campbell
7f82ec1f09 Add snapshot release back 2019-12-18 17:45:13 +00:00
Marc Campbell
7ab1734cb6 Remove manager and collector commands 2019-12-18 01:52:06 +00:00
Marc Campbell
9c4fa8ac14 Add version command 2019-11-30 00:03:43 +00:00
Marc Campbell
14ace5294f Analyze spec 2019-10-29 19:45:25 +00:00
Marc Campbell
25e884c43a Proxy 2019-09-08 15:09:02 +00:00
Marc Campbell
996a55bf90 Support CGO for calling analysis from other languages 2019-08-28 21:30:59 +00:00
Marc Campbell
d37d037ad1 Some fixes to troubleshoot, better error messages 2019-08-15 01:22:17 +00:00
divolgin
012df52f11 rename troubleshoot binary to support-bundle 2019-08-07 21:23:12 +00:00
Marc Campbell
c2fd9cca0c Remove run subcommand 2019-07-26 22:42:09 +00:00
Marc Campbell
1f8927fc0d Revert 2019-07-26 19:42:30 +00:00
Marc Campbell
0bc775192c Building all binaries 2019-07-26 19:14:12 +00:00
Marc Campbell
5e77338507 Release 2019-07-26 18:51:18 +00:00
Marc Campbell
4ea5a259c7 exporting github token for release 2019-07-26 18:43:39 +00:00
Marc Campbell
fa14500e5c Release tokens 2019-07-26 18:16:49 +00:00
Marc Campbell
4e1cca7b8d Windows binaries 2019-07-23 22:47:50 +00:00
Marc Campbell
fd055852e6 release 2019-07-18 21:55:03 +00:00
Marc Campbell
df4edcb80d Running collectors without the CRD 2019-07-18 02:46:42 +00:00
divolgin
9942f4bf65 Adding basic redaction functionality 2019-07-17 22:57:19 +00:00
Marc Campbell
978a4a13ba More 2019-07-12 14:30:38 +00:00
Marc Campbell
e2d0254804 Preflight server and CLI 2019-07-11 21:16:14 +00:00
Marc Campbell
d60de901e3 Run cluster-info in a collector pod 2019-07-11 14:06:42 +00:00
Marc Campbell
277ad11cd1 config/crds 2019-07-09 03:46:27 +00:00
Marc Campbell
a4824db44d first commit 2019-07-08 22:28:05 +00:00
Marc Campbell
b229d56eee Wish i could get this to be inline 2019-07-06 00:44:52 +00:00
Marc Campbell
342eedf4a4 First commit, scaffolding 2019-07-05 22:38:40 +00:00