Commit Graph

54 Commits

Author SHA1 Message Date
Salah Aldeen Al Saleh
3d1d53ee9d ClusterPodStatuses analyzer (#456)
* ClusterPodStatuses analyzer

Co-authored-by: divolgin <dmitriy@replicated.com>
2021-10-25 17:44:59 -07:00
divolgin
20f1b60f11 Include pod logs for pods that are failing 2021-10-26 00:01:26 +00:00
Jalaja Ganapathy
372454651e collector/analyzer for host operating system (#443)
* collector/analyzer for host operating system

* address cr comments

* cleanup

* fix invoking the analyzer
code cleanup

* fix cr comments

* add corner case unit-test

* fix kernel version parsing

* address review comments

* add default case

* parse using regex

* added more testcases and fixed the bug found in cr

* few small things
2021-10-12 14:42:23 -07: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
Jalaja Ganapathy
8a29442a2a Remove ID from host preflight spec (#438) 2021-09-29 09:49:54 -07:00
Jalaja Ganapathy
a0b3b3f7dc add an unique id to each host preflights (#431)
* add an unique id to each host preflights

* auto generated files

* updated schemas for the new field id

* keeping it consistent with the rest of the spec
2021-09-24 13:29:14 -07:00
Salah Aldeen Al Saleh
1bdd3db8c5 update schemas (#428)
* update schemas

* update controller-gen
2021-09-23 11:03:19 -07:00
divolgin
7381d5086c Update troubleshoot api schema 2021-07-01 17:24:00 +00:00
divolgin
a0ce85ae1e Adding troubleshoot.sh/v1beta2 2020-09-01 19:57:11 +00:00
Salah Aldeen Al Saleh
f55b9b6ae4 update schemas + add redactor and supportbundle schemas (#218) 2020-06-23 10:08:59 -07:00
Marc Campbell
bd71222715 Removing more unused code 2020-03-23 10:01:30 -07:00
Marc Campbell
d1ab5a6991 Docs say exclude, code says when 2020-02-10 22:13:07 +00:00
Marc Campbell
899d5d7672 Generate OpenAPISchema 2020-02-10 21:17:11 +00:00
Marc Campbell
3955dab9bc Removing the CRD 2019-12-24 19:26:26 +00:00
Marc Campbell
ca9106e7c9 Merge pull request #93 from replicatedhq/no-collector-cmd
Remove manager and collector commands
2019-12-18 07:14:43 -08:00
Marc Campbell
7ab1734cb6 Remove manager and collector commands 2019-12-18 01:52:06 +00:00
Marc Campbell
c61acdc5de Regenerate 2019-12-18 01:40:06 +00:00
Marc Campbell
ed8453ce6b Distribution analyzer 2019-11-08 23:15:58 +00:00
Marc Campbell
67b25e319b Updated from controller-gen 2019-11-08 01:31:20 +00:00
divolgin
68344b25a4 Automatically upload generated support bundle file 2019-08-20 23:54:28 +00:00
divolgin
79a7eb8fa3 Adding version file, analyzer result format conversions 2019-07-26 22:00:49 +00:00
Marc Campbell
4e1cca7b8d Windows binaries 2019-07-23 22:47:50 +00:00
divolgin
be2fa18e4c adding errors to all collectors 2019-07-23 21:34:51 +00:00
Marc Campbell
d83e11a6e3 regenerated 2019-07-22 19:21:26 +00:00
Marc Campbell
ed0ad7ef01 Image pull secrets 2019-07-22 19:20:42 +00:00
divolgin
a36e6a5d57 Exec collector 2019-07-22 00:15:05 +00:00
Marc Campbell
b764050f89 Merge pull request #16 from replicatedhq/upload
Upload results
2019-07-19 15:44:12 -07:00
Marc Campbell
3e76554358 Upload results 2019-07-19 22:37:53 +00:00
divolgin
0437e9e7ad http collector 2019-07-19 22:21:33 +00:00
Marc Campbell
33a08ff7be Better results 2019-07-19 16:58:32 +00:00
Marc Campbell
a96e17279f preflight ui 2019-07-19 16:40:58 +00:00
Marc Campbell
b0d52643ff use spdy 2019-07-19 02:42:33 +00:00
Marc Campbell
522683164d Working sample 2019-07-19 02:25:08 +00:00
Marc Campbell
1f130a09c7 Copy file collector 2019-07-19 02:24:42 +00:00
Marc Campbell
ae0ff141e9 run command 2019-07-19 00:16:38 +00:00
Marc Campbell
785c3e9208 Moor redact 2019-07-18 23:33:52 +00:00
Marc Campbell
270ccc039a Pod logs 2019-07-18 21:25:30 +00:00
divolgin
82ff465a10 Redactions can be disabled with CLI 2019-07-18 20:50:25 +00:00
Marc Campbell
df4edcb80d Running collectors without the CRD 2019-07-18 02:46:42 +00:00
Marc Campbell
e7174acf07 Ingress preflight 2019-07-17 22:31:54 +00:00
Marc Campbell
92862fff2c CRDs 2019-07-17 22:22:56 +00:00
Marc Campbell
f693073aaf Storage class preflight 2019-07-17 21:30:01 +00:00
Marc Campbell
80253a1eb3 UI 2019-07-17 21:04:07 +00:00
Marc Campbell
4b68be509f Run preflight from CLI 2019-07-17 14:48:36 +00:00
Marc Campbell
978a4a13ba More 2019-07-12 14:30:38 +00:00
Marc Campbell
50cf684213 automatically preflight collect cluster 2019-07-11 23:38:12 +00:00
Marc Campbell
e2d0254804 Preflight server and CLI 2019-07-11 21:16:14 +00:00
Marc Campbell
8ea6dae7a3 Preflights and preflightjobs 2019-07-11 18:38:50 +00:00
Marc Campbell
d60de901e3 Run cluster-info in a collector pod 2019-07-11 14:06:42 +00:00
Marc Campbell
73717329ee Only one 2019-07-09 03:49:42 +00:00