Defining Collectors

Defining Collectors

All collectors are specified in a single YAML file. To build a set of collectors, start with a Kubernetes YAML file:

apiVersion: troubleshoot.replicated.com/v1beta1
kind: Collector
metadata:
  name: my-application-name
spec: []

The above file is a simple but valid support bundle spec. It will collect only the default data.

To add additional collectors, read the docs in this section to understand each one, and add them as an array item below spec.

For example, a complete spec might be:

apiVersion: troubleshoot.replicated.com/v1beta1
kind: Collector
metadata:
  name: my-application-name
spec:
  - clusterInfo: {}
  - clusterResources: {}
  - logs:
      selector:
        - app=api
      namespace: default
      limits:
        maxAge: 30d
        maxLines: 1000
  - http:
      name: healthz
      get:
        url: http://api:3000/healthz
  - exec:
      name: mysql-version
      selector:
        - app=mysql
      namespace: default
      command: ["mysql"]
      args: ["-V"]
      timeout: 5s