diff --git a/config/crds/troubleshoot.sh_analyzers.yaml b/config/crds/troubleshoot.sh_analyzers.yaml index 7ee329ea..57d12ec7 100644 --- a/config/crds/troubleshoot.sh_analyzers.yaml +++ b/config/crds/troubleshoot.sh_analyzers.yaml @@ -874,6 +874,47 @@ spec: - outcomes - storageClassName type: object + sysctl: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object textAnalyze: properties: checkName: diff --git a/config/crds/troubleshoot.sh_collectors.yaml b/config/crds/troubleshoot.sh_collectors.yaml index 794719f4..e361faa5 100644 --- a/config/crds/troubleshoot.sh_collectors.yaml +++ b/config/crds/troubleshoot.sh_collectors.yaml @@ -473,6 +473,37 @@ spec: type: string type: array type: object + sysctl: + properties: + collectorName: + type: string + exclude: + type: BoolString + image: + type: string + imagePullPolicy: + type: string + imagePullSecret: + properties: + data: + additionalProperties: + type: string + type: object + name: + type: string + type: + type: string + type: object + name: + type: string + namespace: + type: string + timeout: + type: string + required: + - image + - namespace + type: object type: object type: array type: object diff --git a/config/crds/troubleshoot.sh_hostcollectors.yaml b/config/crds/troubleshoot.sh_hostcollectors.yaml index aca55c3f..5785c01f 100644 --- a/config/crds/troubleshoot.sh_hostcollectors.yaml +++ b/config/crds/troubleshoot.sh_hostcollectors.yaml @@ -1,10 +1,10 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.2.5 + controller-gen.kubebuilder.io/version: v0.7.0 creationTimestamp: null name: hostcollectors.troubleshoot.sh spec: @@ -15,509 +15,998 @@ spec: plural: hostcollectors singular: hostcollector scope: Namespaced - validation: - openAPIV3Schema: - description: HostCollector is the Schema for the collectors API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: CollectorSpec defines the desired state of Collector - properties: - afterCollection: - items: - properties: - callback: - properties: - method: - type: string - redactUri: - type: string - uri: - type: string - required: - - method - - redactUri - - uri - type: object - uploadResultsTo: - properties: - method: - type: string - redactUri: - type: string - uri: - type: string - required: - - method - - redactUri - - uri - type: object - type: object - type: array - collectors: - items: - properties: - ceph: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - namespace: - type: string - timeout: - type: string - required: - - namespace - type: object - clusterInfo: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - type: object - clusterResources: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - type: object - collectd: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - hostPath: - type: string - image: - type: string - imagePullPolicy: - type: string - imagePullSecret: - properties: - data: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - namespace: - type: string - timeout: - type: string - required: - - hostPath - - image - - namespace - type: object - copy: - properties: - collectorName: - type: string - containerName: - type: string - containerPath: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - name: - type: string - namespace: - type: string - selector: - items: - type: string - type: array - required: - - containerPath - - namespace - - selector - type: object - data: - properties: - collectorName: - type: string - data: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - name: - type: string - required: - - data - type: object - exec: - properties: - args: - items: - type: string - type: array - collectorName: - type: string - command: - items: - type: string - type: array - containerName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - name: - type: string - namespace: - type: string - selector: - items: - type: string - type: array - timeout: - type: string - required: - - namespace - - selector - type: object - http: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - get: - properties: - headers: - additionalProperties: - type: string - type: object - insecureSkipVerify: - type: boolean - url: - type: string - required: - - url - type: object - name: - type: string - post: - properties: - body: - type: string - headers: - additionalProperties: - type: string - type: object - insecureSkipVerify: - type: boolean - url: - type: string - required: - - url - type: object - put: - properties: - body: - type: string - headers: - additionalProperties: - type: string - type: object - insecureSkipVerify: - type: boolean - url: - type: string - required: - - url - type: object - type: object - kernelModules: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - namespace: - type: string - nodeSelector: - additionalProperties: - type: string - type: object - timeout: - type: string - required: - - namespace - type: object - logs: - properties: - collectorName: - type: string - containerNames: - items: - type: string - type: array - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - limits: - properties: - maxAge: - type: string - maxLines: - format: int64 - type: integer - sinceTime: - format: date-time - type: string - type: object - name: - type: string - namespace: - type: string - selector: - items: - type: string - type: array - required: - - selector - type: object - longhorn: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - namespace: - type: string - timeout: - type: string - required: - - namespace - type: object - mysql: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - uri: - type: string - required: - - uri - type: object - postgres: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - uri: - type: string - required: - - uri - type: object - redis: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - uri: - type: string - required: - - uri - type: object - registryImages: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - imagePullSecret: - properties: - data: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - images: - items: - type: string - type: array - namespace: - type: string - required: - - images - - namespace - type: object - run: - properties: - args: - items: - type: string - type: array - collectorName: - type: string - command: - items: - type: string - type: array - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - image: - type: string - imagePullPolicy: - type: string - imagePullSecret: - properties: - data: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - name: - type: string - namespace: - type: string - timeout: - type: string - required: - - image - - namespace - type: object - secret: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - includeValue: - type: boolean - key: - type: string - name: - type: string - namespace: - type: string - required: - - name - type: object - type: object - type: array - type: object - status: - description: CollectorStatus defines the observed state of Collector - type: object - type: object - version: v1beta2 versions: - name: v1beta2 + schema: + openAPIV3Schema: + description: HostCollector is the Schema for the collectors API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: HostCollectorSpec defines the desired state of HostCollector + properties: + analyzers: + items: + properties: + blockDevices: + properties: + checkName: + type: string + exclude: + type: BoolString + includeUnmountedPartitions: + type: boolean + minimumAcceptableSize: + format: int64 + type: integer + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - includeUnmountedPartitions + - minimumAcceptableSize + - outcomes + type: object + certificate: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + cpu: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + diskUsage: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + filesystemPerformance: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + hostOS: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + hostServices: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + http: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + httpLoadBalancer: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + ipv4Interfaces: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + kernelModules: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + memory: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + tcpConnect: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + tcpLoadBalancer: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + tcpPortStatus: + properties: + checkName: + type: string + collectorName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + time: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object + type: object + type: array + collectors: + items: + properties: + blockDevices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + certificate: + properties: + certificatePath: + type: string + collectorName: + type: string + exclude: + type: BoolString + keyPath: + type: string + required: + - certificatePath + - keyPath + type: object + cpu: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + diskUsage: + properties: + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + required: + - path + type: object + filesystemPerformance: + description: FilesystemPerformance benchmarks sequential write + latency on a single file. The optional background IOPS feature + attempts to mimic real-world conditions by running read and + write workloads prior to and during benchmark execution. + properties: + backgroundIOPSWarmupSeconds: + description: How long to run the background IOPS read and + write workloads prior to starting the benchmarks. + type: integer + backgroundReadIOPS: + description: The target read IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background read jobs. + type: integer + backgroundReadIOPSJobs: + description: Number of threads to use for background read + IOPS. This should be set high enough to reach the target + specified in BackgrounReadIOPS. + type: integer + backgroundWriteIOPS: + description: The target write IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background write jobs. + type: integer + backgroundWriteIOPSJobs: + description: 'Number of threads to use for background write + IOPS. This should be set high enough to reach the target + specified in BackgroundWriteIOPS. Example: If BackgroundWriteIOPS + is 100 and write latency is 10ms then a single job would + barely be able to reach 100 IOPS so this should be at + least 2.' + type: integer + collectorName: + type: string + datasync: + description: Whether to call datasync on the file after + each write. Skipped if Sync is also true. Does not apply + to background IOPS task. + type: boolean + directory: + description: The directory where the benchmark will create + files. + type: string + enableBackgroundIOPS: + description: Enable the background IOPS feature. + type: boolean + exclude: + type: BoolString + fileSize: + description: The size of the file used in the benchmark. + The number of IO operations for the benchmark will be + FileSize / OperationSizeBytes. Accepts valid Kubernetes + resource units such as Mi. + type: string + operationSize: + description: The size of each write operation performed + while benchmarking. This does not apply to the background + IOPS feature if enabled, since those must be fixed at + 4096. + format: int64 + type: integer + sync: + description: Whether to call sync on the file after each + write. Does not apply to background IOPS task. + type: boolean + timeout: + description: Total timeout, including background IOPS setup + and warmup if enabled. + type: string + required: + - backgroundIOPSWarmupSeconds + - backgroundReadIOPS + - backgroundReadIOPSJobs + - backgroundWriteIOPS + - backgroundWriteIOPSJobs + - enableBackgroundIOPS + type: object + hostOS: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + hostServices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + http: + properties: + collectorName: + type: string + exclude: + type: BoolString + get: + properties: + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + post: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + put: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + type: object + httpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + port: + type: integer + timeout: + type: string + required: + - address + - path + - port + type: object + ipv4Interfaces: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + kernelModules: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + kubernetes: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + memory: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + tcpConnect: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + timeout: + type: string + required: + - address + type: object + tcpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + port: + type: integer + timeout: + type: string + required: + - address + - port + type: object + tcpPortStatus: + properties: + collectorName: + type: string + exclude: + type: BoolString + interface: + type: string + port: + type: integer + required: + - port + type: object + time: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + type: object + type: array + type: object + status: + description: HostCollectorStatus defines the observed state of HostCollector + type: object + type: object served: true storage: true status: diff --git a/config/crds/troubleshoot.sh_hostpreflights.yaml b/config/crds/troubleshoot.sh_hostpreflights.yaml index e5101d7e..7aa83f3f 100644 --- a/config/crds/troubleshoot.sh_hostpreflights.yaml +++ b/config/crds/troubleshoot.sh_hostpreflights.yaml @@ -466,6 +466,47 @@ spec: required: - outcomes type: object + kernelModules: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object memory: properties: checkName: @@ -889,6 +930,13 @@ spec: exclude: type: BoolString type: object + kernelModules: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object kubernetes: properties: collectorName: @@ -954,6 +1002,274 @@ spec: type: object type: object type: array + remoteCollectors: + items: + properties: + blockDevices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + certificate: + properties: + certificatePath: + type: string + collectorName: + type: string + exclude: + type: BoolString + keyPath: + type: string + required: + - certificatePath + - keyPath + type: object + cpu: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + diskUsage: + properties: + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + required: + - path + type: object + filesystemPerformance: + description: RemoteFilesystemPerformance benchmarks sequential + write latency on a single file. The optional background IOPS + feature attempts to mimic real-world conditions by running + read and write workloads prior to and during benchmark execution. + properties: + backgroundIOPSWarmupSeconds: + description: How long to run the background IOPS read and + write workloads prior to starting the benchmarks. + type: integer + backgroundReadIOPS: + description: The target read IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background read jobs. + type: integer + backgroundReadIOPSJobs: + description: Number of threads to use for background read + IOPS. This should be set high enough to reach the target + specified in BackgrounReadIOPS. + type: integer + backgroundWriteIOPS: + description: The target write IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background write jobs. + type: integer + backgroundWriteIOPSJobs: + description: 'Number of threads to use for background write + IOPS. This should be set high enough to reach the target + specified in BackgroundWriteIOPS. Example: If BackgroundWriteIOPS + is 100 and write latency is 10ms then a single job would + barely be able to reach 100 IOPS so this should be at + least 2.' + type: integer + collectorName: + type: string + datasync: + description: Whether to call datasync on the file after + each write. Skipped if Sync is also true. Does not apply + to background IOPS task. + type: boolean + directory: + description: The directory where the benchmark will create + files. + type: string + enableBackgroundIOPS: + description: Enable the background IOPS feature. + type: boolean + exclude: + type: BoolString + fileSize: + description: The size of the file used in the benchmark. + The number of IO operations for the benchmark will be + FileSize / OperationSizeBytes. Accepts valid Kubernetes + resource units such as Mi. + type: string + operationSize: + description: The size of each write operation performed + while benchmarking. This does not apply to the background + IOPS feature if enabled, since those must be fixed at + 4096. + format: int64 + type: integer + sync: + description: Whether to call sync on the file after each + write. Does not apply to background IOPS task. + type: boolean + timeout: + description: Total timeout, including background IOPS setup + and warmup if enabled. + type: string + required: + - backgroundIOPSWarmupSeconds + - backgroundReadIOPS + - backgroundReadIOPSJobs + - backgroundWriteIOPS + - backgroundWriteIOPSJobs + - enableBackgroundIOPS + type: object + hostServices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + http: + properties: + collectorName: + type: string + exclude: + type: BoolString + get: + properties: + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + post: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + put: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + type: object + httpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + port: + type: integer + timeout: + type: string + required: + - address + - path + - port + type: object + ipv4Interfaces: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + kernelModules: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + memory: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + tcpConnect: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + timeout: + type: string + required: + - address + type: object + tcpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + port: + type: integer + timeout: + type: string + required: + - address + - port + type: object + tcpPortStatus: + properties: + collectorName: + type: string + exclude: + type: BoolString + interface: + type: string + port: + type: integer + required: + - port + type: object + time: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + type: object + type: array type: object status: description: HostPreflightStatus defines the observed state of HostPreflight diff --git a/config/crds/troubleshoot.sh_preflights.yaml b/config/crds/troubleshoot.sh_preflights.yaml index 967f24e3..95c0f37d 100644 --- a/config/crds/troubleshoot.sh_preflights.yaml +++ b/config/crds/troubleshoot.sh_preflights.yaml @@ -874,6 +874,47 @@ spec: - outcomes - storageClassName type: object + sysctl: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object textAnalyze: properties: checkName: @@ -1342,6 +1383,305 @@ spec: type: string type: array type: object + sysctl: + properties: + collectorName: + type: string + exclude: + type: BoolString + image: + type: string + imagePullPolicy: + type: string + imagePullSecret: + properties: + data: + additionalProperties: + type: string + type: object + name: + type: string + type: + type: string + type: object + name: + type: string + namespace: + type: string + timeout: + type: string + required: + - image + - namespace + type: object + type: object + type: array + remoteCollectors: + items: + properties: + blockDevices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + certificate: + properties: + certificatePath: + type: string + collectorName: + type: string + exclude: + type: BoolString + keyPath: + type: string + required: + - certificatePath + - keyPath + type: object + cpu: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + diskUsage: + properties: + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + required: + - path + type: object + filesystemPerformance: + description: RemoteFilesystemPerformance benchmarks sequential + write latency on a single file. The optional background IOPS + feature attempts to mimic real-world conditions by running + read and write workloads prior to and during benchmark execution. + properties: + backgroundIOPSWarmupSeconds: + description: How long to run the background IOPS read and + write workloads prior to starting the benchmarks. + type: integer + backgroundReadIOPS: + description: The target read IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background read jobs. + type: integer + backgroundReadIOPSJobs: + description: Number of threads to use for background read + IOPS. This should be set high enough to reach the target + specified in BackgrounReadIOPS. + type: integer + backgroundWriteIOPS: + description: The target write IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background write jobs. + type: integer + backgroundWriteIOPSJobs: + description: 'Number of threads to use for background write + IOPS. This should be set high enough to reach the target + specified in BackgroundWriteIOPS. Example: If BackgroundWriteIOPS + is 100 and write latency is 10ms then a single job would + barely be able to reach 100 IOPS so this should be at + least 2.' + type: integer + collectorName: + type: string + datasync: + description: Whether to call datasync on the file after + each write. Skipped if Sync is also true. Does not apply + to background IOPS task. + type: boolean + directory: + description: The directory where the benchmark will create + files. + type: string + enableBackgroundIOPS: + description: Enable the background IOPS feature. + type: boolean + exclude: + type: BoolString + fileSize: + description: The size of the file used in the benchmark. + The number of IO operations for the benchmark will be + FileSize / OperationSizeBytes. Accepts valid Kubernetes + resource units such as Mi. + type: string + operationSize: + description: The size of each write operation performed + while benchmarking. This does not apply to the background + IOPS feature if enabled, since those must be fixed at + 4096. + format: int64 + type: integer + sync: + description: Whether to call sync on the file after each + write. Does not apply to background IOPS task. + type: boolean + timeout: + description: Total timeout, including background IOPS setup + and warmup if enabled. + type: string + required: + - backgroundIOPSWarmupSeconds + - backgroundReadIOPS + - backgroundReadIOPSJobs + - backgroundWriteIOPS + - backgroundWriteIOPSJobs + - enableBackgroundIOPS + type: object + hostServices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + http: + properties: + collectorName: + type: string + exclude: + type: BoolString + get: + properties: + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + post: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + put: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + type: object + httpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + port: + type: integer + timeout: + type: string + required: + - address + - path + - port + type: object + ipv4Interfaces: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + kernelModules: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + memory: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + tcpConnect: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + timeout: + type: string + required: + - address + type: object + tcpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + port: + type: integer + timeout: + type: string + required: + - address + - port + type: object + tcpPortStatus: + properties: + collectorName: + type: string + exclude: + type: BoolString + interface: + type: string + port: + type: integer + required: + - port + type: object + time: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object type: object type: array uploadResultsTo: diff --git a/config/crds/troubleshoot.sh_remotecollectors.yaml b/config/crds/troubleshoot.sh_remotecollectors.yaml index d17a8ca0..79b91af1 100644 --- a/config/crds/troubleshoot.sh_remotecollectors.yaml +++ b/config/crds/troubleshoot.sh_remotecollectors.yaml @@ -1,10 +1,10 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.2.5 + controller-gen.kubebuilder.io/version: v0.7.0 creationTimestamp: null name: remotecollectors.troubleshoot.sh spec: @@ -15,513 +15,335 @@ spec: plural: remotecollectors singular: remotecollector scope: Namespaced - validation: - openAPIV3Schema: - description: RemoteCollector is the Schema for the remote collectors API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: RemoteCollectorSpec defines the desired state of the RemoteCollector - properties: - afterCollection: - items: - properties: - callback: - properties: - method: - type: string - redactUri: - type: string - uri: - type: string - required: - - method - - redactUri - - uri - type: object - uploadResultsTo: - properties: - method: - type: string - redactUri: - type: string - uri: - type: string - required: - - method - - redactUri - - uri - type: object - type: object - type: array - collectors: - items: - properties: - ceph: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - namespace: - type: string - timeout: - type: string - required: - - namespace - type: object - clusterInfo: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - type: object - clusterResources: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - type: object - collectd: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - hostPath: - type: string - image: - type: string - imagePullPolicy: - type: string - imagePullSecret: - properties: - data: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - namespace: - type: string - timeout: - type: string - required: - - hostPath - - image - - namespace - type: object - copy: - properties: - collectorName: - type: string - containerName: - type: string - containerPath: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - name: - type: string - namespace: - type: string - selector: - items: - type: string - type: array - required: - - containerPath - - namespace - - selector - type: object - data: - properties: - collectorName: - type: string - data: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - name: - type: string - required: - - data - type: object - exec: - properties: - args: - items: - type: string - type: array - collectorName: - type: string - command: - items: - type: string - type: array - containerName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - name: - type: string - namespace: - type: string - selector: - items: - type: string - type: array - timeout: - type: string - required: - - namespace - - selector - type: object - http: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - get: - properties: - headers: - additionalProperties: - type: string - type: object - insecureSkipVerify: - type: boolean - url: - type: string - required: - - url - type: object - name: - type: string - post: - properties: - body: - type: string - headers: - additionalProperties: - type: string - type: object - insecureSkipVerify: - type: boolean - url: - type: string - required: - - url - type: object - put: - properties: - body: - type: string - headers: - additionalProperties: - type: string - type: object - insecureSkipVerify: - type: boolean - url: - type: string - required: - - url - type: object - type: object - kernelModules: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - namespace: - type: string - nodeSelector: - additionalProperties: - type: string - type: object - timeout: - type: string - required: - - namespace - type: object - logs: - properties: - collectorName: - type: string - containerNames: - items: - type: string - type: array - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - limits: - properties: - maxAge: - type: string - maxLines: - format: int64 - type: integer - sinceTime: - format: date-time - type: string - type: object - name: - type: string - namespace: - type: string - selector: - items: - type: string - type: array - required: - - selector - type: object - longhorn: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - namespace: - type: string - timeout: - type: string - required: - - namespace - type: object - mysql: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - uri: - type: string - required: - - uri - type: object - postgres: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - uri: - type: string - required: - - uri - type: object - redis: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - uri: - type: string - required: - - uri - type: object - registryImages: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - imagePullSecret: - properties: - data: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - images: - items: - type: string - type: array - namespace: - type: string - required: - - images - - namespace - type: object - run: - properties: - args: - items: - type: string - type: array - collectorName: - type: string - command: - items: - type: string - type: array - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - image: - type: string - imagePullPolicy: - type: string - imagePullSecret: - properties: - data: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - name: - type: string - namespace: - type: string - timeout: - type: string - required: - - image - - namespace - type: object - secret: - properties: - collectorName: - type: string - exclude: - description: BoolOrString is a type that can hold an bool - or a string. When used in JSON or YAML marshalling and - unmarshalling, it produces or consumes the inner type. This - allows you to have, for example, a JSON field that can accept - a booolean string or raw bool. - type: BoolString - includeValue: - type: boolean - key: - type: string - name: - type: string - namespace: - type: string - required: - - name - type: object - type: object - type: array - nodeSelector: - additionalProperties: - type: string - type: object - type: object - status: - description: CollectorStatus defines the observed state of Collector - type: object - type: object - version: v1beta2 versions: - name: v1beta2 + schema: + openAPIV3Schema: + description: RemoteCollector is the Schema for the remote collectors API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: RemoteCollectorSpec defines the desired state of the RemoteCollector + properties: + afterCollection: + items: + properties: + callback: + properties: + method: + type: string + redactUri: + type: string + uri: + type: string + required: + - method + - redactUri + - uri + type: object + uploadResultsTo: + properties: + method: + type: string + redactUri: + type: string + uri: + type: string + required: + - method + - redactUri + - uri + type: object + type: object + type: array + collectors: + items: + properties: + blockDevices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + certificate: + properties: + certificatePath: + type: string + collectorName: + type: string + exclude: + type: BoolString + keyPath: + type: string + required: + - certificatePath + - keyPath + type: object + cpu: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + diskUsage: + properties: + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + required: + - path + type: object + filesystemPerformance: + description: RemoteFilesystemPerformance benchmarks sequential + write latency on a single file. The optional background IOPS + feature attempts to mimic real-world conditions by running + read and write workloads prior to and during benchmark execution. + properties: + backgroundIOPSWarmupSeconds: + description: How long to run the background IOPS read and + write workloads prior to starting the benchmarks. + type: integer + backgroundReadIOPS: + description: The target read IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background read jobs. + type: integer + backgroundReadIOPSJobs: + description: Number of threads to use for background read + IOPS. This should be set high enough to reach the target + specified in BackgrounReadIOPS. + type: integer + backgroundWriteIOPS: + description: The target write IOPS to run while benchmarking. + This is a limit and there is no guarantee it will be reached. + This is the total IOPS for all background write jobs. + type: integer + backgroundWriteIOPSJobs: + description: 'Number of threads to use for background write + IOPS. This should be set high enough to reach the target + specified in BackgroundWriteIOPS. Example: If BackgroundWriteIOPS + is 100 and write latency is 10ms then a single job would + barely be able to reach 100 IOPS so this should be at + least 2.' + type: integer + collectorName: + type: string + datasync: + description: Whether to call datasync on the file after + each write. Skipped if Sync is also true. Does not apply + to background IOPS task. + type: boolean + directory: + description: The directory where the benchmark will create + files. + type: string + enableBackgroundIOPS: + description: Enable the background IOPS feature. + type: boolean + exclude: + type: BoolString + fileSize: + description: The size of the file used in the benchmark. + The number of IO operations for the benchmark will be + FileSize / OperationSizeBytes. Accepts valid Kubernetes + resource units such as Mi. + type: string + operationSize: + description: The size of each write operation performed + while benchmarking. This does not apply to the background + IOPS feature if enabled, since those must be fixed at + 4096. + format: int64 + type: integer + sync: + description: Whether to call sync on the file after each + write. Does not apply to background IOPS task. + type: boolean + timeout: + description: Total timeout, including background IOPS setup + and warmup if enabled. + type: string + required: + - backgroundIOPSWarmupSeconds + - backgroundReadIOPS + - backgroundReadIOPSJobs + - backgroundWriteIOPS + - backgroundWriteIOPSJobs + - enableBackgroundIOPS + type: object + hostServices: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + http: + properties: + collectorName: + type: string + exclude: + type: BoolString + get: + properties: + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + post: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + put: + properties: + body: + type: string + headers: + additionalProperties: + type: string + type: object + insecureSkipVerify: + type: boolean + url: + type: string + required: + - url + type: object + type: object + httpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + path: + type: string + port: + type: integer + timeout: + type: string + required: + - address + - path + - port + type: object + ipv4Interfaces: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + kernelModules: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + memory: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + tcpConnect: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + timeout: + type: string + required: + - address + type: object + tcpLoadBalancer: + properties: + address: + type: string + collectorName: + type: string + exclude: + type: BoolString + port: + type: integer + timeout: + type: string + required: + - address + - port + type: object + tcpPortStatus: + properties: + collectorName: + type: string + exclude: + type: BoolString + interface: + type: string + port: + type: integer + required: + - port + type: object + time: + properties: + collectorName: + type: string + exclude: + type: BoolString + type: object + type: object + type: array + nodeSelector: + additionalProperties: + type: string + type: object + type: object + status: + description: CollectorStatus defines the observed state of Collector + type: object + type: object served: true storage: true status: diff --git a/config/crds/troubleshoot.sh_supportbundles.yaml b/config/crds/troubleshoot.sh_supportbundles.yaml index e92c6701..ce340d0d 100644 --- a/config/crds/troubleshoot.sh_supportbundles.yaml +++ b/config/crds/troubleshoot.sh_supportbundles.yaml @@ -905,6 +905,47 @@ spec: - outcomes - storageClassName type: object + sysctl: + properties: + checkName: + type: string + exclude: + type: BoolString + outcomes: + items: + properties: + fail: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + pass: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + warn: + properties: + message: + type: string + uri: + type: string + when: + type: string + type: object + type: object + type: array + required: + - outcomes + type: object textAnalyze: properties: checkName: @@ -1373,6 +1414,37 @@ spec: type: string type: array type: object + sysctl: + properties: + collectorName: + type: string + exclude: + type: BoolString + image: + type: string + imagePullPolicy: + type: string + imagePullSecret: + properties: + data: + additionalProperties: + type: string + type: object + name: + type: string + type: + type: string + type: object + name: + type: string + namespace: + type: string + timeout: + type: string + required: + - image + - namespace + type: object type: object type: array type: object diff --git a/pkg/collect/cluster_resources.go b/pkg/collect/cluster_resources.go index 0b7f126c..7b99c93a 100644 --- a/pkg/collect/cluster_resources.go +++ b/pkg/collect/cluster_resources.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "path" // this code uses 'path' and not 'path/filepath' because we don't want backslashes on windows + "path/filepath" "strings" troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2" @@ -66,12 +67,29 @@ func ClusterResources(c *Collector, clusterResourcesCollector *troubleshootv1bet } // pods - pods, podErrors := pods(ctx, client, namespaceNames) + pods, podErrors, failedPods := pods(ctx, client, namespaceNames) for k, v := range pods { output.SaveResult(c.BundlePath, path.Join("cluster-resources/pods", k), bytes.NewBuffer(v)) } output.SaveResult(c.BundlePath, "cluster-resources/pods-errors.json", marshalErrors(podErrors)) + for _, pod := range failedPods { + for _, container := range pod.Spec.Containers { + logsRoot := path.Join(c.BundlePath, "cluster-resources", "pods", pod.Namespace, "logs") + limits := &troubleshootv1beta2.LogLimits{ + MaxLines: 500, + } + podLogs, err := savePodLogs(ctx, logsRoot, client, pod, "", container.Name, limits, false) + if err != nil { + errPath := filepath.Join("cluster-resources", "pods", "logs", pod.Namespace, pod.Name, fmt.Sprintf("%s-logs-errors.log", container.Name)) + output.SaveResult(c.BundlePath, errPath, bytes.NewBuffer([]byte(err.Error()))) + } + for k, v := range podLogs { + output[filepath.Join("cluster-resources", "pods", pod.Namespace, "logs", k)] = v + } + } + } + // services services, servicesErrors := services(ctx, client, namespaceNames) for k, v := range services { @@ -234,9 +252,10 @@ func getNamespace(ctx context.Context, client *kubernetes.Clientset, namespace s return b, nil } -func pods(ctx context.Context, client *kubernetes.Clientset, namespaces []string) (map[string][]byte, map[string]string) { +func pods(ctx context.Context, client *kubernetes.Clientset, namespaces []string) (map[string][]byte, map[string]string, []corev1.Pod) { podsByNamespace := make(map[string][]byte) errorsByNamespace := make(map[string]string) + failedPods := []corev1.Pod{} for _, namespace := range namespaces { pods, err := client.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{}) @@ -251,10 +270,16 @@ func pods(ctx context.Context, client *kubernetes.Clientset, namespaces []string continue } + for _, pod := range pods.Items { + if pod.Status.Phase == corev1.PodFailed { + failedPods = append(failedPods, pod) + } + } + podsByNamespace[namespace+".json"] = b } - return podsByNamespace, errorsByNamespace + return podsByNamespace, errorsByNamespace, failedPods } func services(ctx context.Context, client *kubernetes.Clientset, namespaces []string) (map[string][]byte, map[string]string) { diff --git a/schemas/analyzer-troubleshoot-v1beta2.json b/schemas/analyzer-troubleshoot-v1beta2.json index e40998b9..5289eecc 100644 --- a/schemas/analyzer-troubleshoot-v1beta2.json +++ b/schemas/analyzer-troubleshoot-v1beta2.json @@ -1311,6 +1311,70 @@ } } }, + "sysctl": { + "type": "object", + "required": [ + "outcomes" + ], + "properties": { + "checkName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "outcomes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fail": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + }, + "pass": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + }, + "warn": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + } + } + } + } + } + }, "textAnalyze": { "type": "object", "required": [ diff --git a/schemas/collector-troubleshoot-v1beta2.json b/schemas/collector-troubleshoot-v1beta2.json index 2fb2d488..096c6221 100644 --- a/schemas/collector-troubleshoot-v1beta2.json +++ b/schemas/collector-troubleshoot-v1beta2.json @@ -432,33 +432,6 @@ } } }, - "kernelModules": { - "type": "object", - "required": [ - "namespace" - ], - "properties": { - "collectorName": { - "type": "string" - }, - "exclude": { - "description": "BoolOrString is a type that can hold an bool or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a booolean string or raw bool.", - "oneOf": [{"type": "string"},{"type": "boolean"}] - }, - "namespace": { - "type": "string" - }, - "nodeSelector": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "timeout": { - "type": "string" - } - } - }, "logs": { "type": "object", "required": [ @@ -706,6 +679,53 @@ } } } + }, + "sysctl": { + "type": "object", + "required": [ + "image", + "namespace" + ], + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "type": "string" + }, + "imagePullSecret": { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "timeout": { + "type": "string" + } + } } } } diff --git a/schemas/preflight-troubleshoot-v1beta2.json b/schemas/preflight-troubleshoot-v1beta2.json index 96d7075b..e2a81f11 100644 --- a/schemas/preflight-troubleshoot-v1beta2.json +++ b/schemas/preflight-troubleshoot-v1beta2.json @@ -1311,6 +1311,70 @@ } } }, + "sysctl": { + "type": "object", + "required": [ + "outcomes" + ], + "properties": { + "checkName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "outcomes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fail": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + }, + "pass": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + }, + "warn": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + } + } + } + } + } + }, "textAnalyze": { "type": "object", "required": [ @@ -1776,33 +1840,6 @@ } } }, - "kernelModules": { - "type": "object", - "required": [ - "namespace" - ], - "properties": { - "collectorName": { - "type": "string" - }, - "exclude": { - "description": "BoolOrString is a type that can hold an bool or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a booolean string or raw bool.", - "oneOf": [{"type": "string"},{"type": "boolean"}] - }, - "namespace": { - "type": "string" - }, - "nodeSelector": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "timeout": { - "type": "string" - } - } - }, "logs": { "type": "object", "required": [ @@ -2050,6 +2087,414 @@ } } } + }, + "sysctl": { + "type": "object", + "required": [ + "image", + "namespace" + ], + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "type": "string" + }, + "imagePullSecret": { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "timeout": { + "type": "string" + } + } + } + } + } + }, + "remoteCollectors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "blockDevices": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + } + } + }, + "certificate": { + "type": "object", + "required": [ + "certificatePath", + "keyPath" + ], + "properties": { + "certificatePath": { + "type": "string" + }, + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "keyPath": { + "type": "string" + } + } + }, + "cpu": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + } + } + }, + "diskUsage": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "path": { + "type": "string" + } + } + }, + "filesystemPerformance": { + "description": "RemoteFilesystemPerformance benchmarks sequential write latency on a single file. The optional background IOPS feature attempts to mimic real-world conditions by running read and write workloads prior to and during benchmark execution.", + "type": "object", + "required": [ + "backgroundIOPSWarmupSeconds", + "backgroundReadIOPS", + "backgroundReadIOPSJobs", + "backgroundWriteIOPS", + "backgroundWriteIOPSJobs", + "enableBackgroundIOPS" + ], + "properties": { + "backgroundIOPSWarmupSeconds": { + "description": "How long to run the background IOPS read and write workloads prior to starting the benchmarks.", + "type": "integer" + }, + "backgroundReadIOPS": { + "description": "The target read IOPS to run while benchmarking. This is a limit and there is no guarantee it will be reached. This is the total IOPS for all background read jobs.", + "type": "integer" + }, + "backgroundReadIOPSJobs": { + "description": "Number of threads to use for background read IOPS. This should be set high enough to reach the target specified in BackgrounReadIOPS.", + "type": "integer" + }, + "backgroundWriteIOPS": { + "description": "The target write IOPS to run while benchmarking. This is a limit and there is no guarantee it will be reached. This is the total IOPS for all background write jobs.", + "type": "integer" + }, + "backgroundWriteIOPSJobs": { + "description": "Number of threads to use for background write IOPS. This should be set high enough to reach the target specified in BackgroundWriteIOPS. Example: If BackgroundWriteIOPS is 100 and write latency is 10ms then a single job would barely be able to reach 100 IOPS so this should be at least 2.", + "type": "integer" + }, + "collectorName": { + "type": "string" + }, + "datasync": { + "description": "Whether to call datasync on the file after each write. Skipped if Sync is also true. Does not apply to background IOPS task.", + "type": "boolean" + }, + "directory": { + "description": "The directory where the benchmark will create files.", + "type": "string" + }, + "enableBackgroundIOPS": { + "description": "Enable the background IOPS feature.", + "type": "boolean" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "fileSize": { + "description": "The size of the file used in the benchmark. The number of IO operations for the benchmark will be FileSize / OperationSizeBytes. Accepts valid Kubernetes resource units such as Mi.", + "type": "string" + }, + "operationSize": { + "description": "The size of each write operation performed while benchmarking. This does not apply to the background IOPS feature if enabled, since those must be fixed at 4096.", + "type": "integer", + "format": "int64" + }, + "sync": { + "description": "Whether to call sync on the file after each write. Does not apply to background IOPS task.", + "type": "boolean" + }, + "timeout": { + "description": "Total timeout, including background IOPS setup and warmup if enabled.", + "type": "string" + } + } + }, + "hostServices": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + } + } + }, + "http": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "get": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "insecureSkipVerify": { + "type": "boolean" + }, + "url": { + "type": "string" + } + } + }, + "post": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "body": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "insecureSkipVerify": { + "type": "boolean" + }, + "url": { + "type": "string" + } + } + }, + "put": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "body": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "insecureSkipVerify": { + "type": "boolean" + }, + "url": { + "type": "string" + } + } + } + } + }, + "httpLoadBalancer": { + "type": "object", + "required": [ + "address", + "path", + "port" + ], + "properties": { + "address": { + "type": "string" + }, + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "path": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "timeout": { + "type": "string" + } + } + }, + "ipv4Interfaces": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + } + } + }, + "kernelModules": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + } + } + }, + "memory": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + } + } + }, + "tcpConnect": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + }, + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "timeout": { + "type": "string" + } + } + }, + "tcpLoadBalancer": { + "type": "object", + "required": [ + "address", + "port" + ], + "properties": { + "address": { + "type": "string" + }, + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "port": { + "type": "integer" + }, + "timeout": { + "type": "string" + } + } + }, + "tcpPortStatus": { + "type": "object", + "required": [ + "port" + ], + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "interface": { + "type": "string" + }, + "port": { + "type": "integer" + } + } + }, + "time": { + "type": "object", + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + } + } } } } diff --git a/schemas/supportbundle-troubleshoot-v1beta2.json b/schemas/supportbundle-troubleshoot-v1beta2.json index 08e18a3d..1deba44a 100644 --- a/schemas/supportbundle-troubleshoot-v1beta2.json +++ b/schemas/supportbundle-troubleshoot-v1beta2.json @@ -1357,6 +1357,70 @@ } } }, + "sysctl": { + "type": "object", + "required": [ + "outcomes" + ], + "properties": { + "checkName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "outcomes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fail": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + }, + "pass": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + }, + "warn": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "when": { + "type": "string" + } + } + } + } + } + } + } + }, "textAnalyze": { "type": "object", "required": [ @@ -1822,33 +1886,6 @@ } } }, - "kernelModules": { - "type": "object", - "required": [ - "namespace" - ], - "properties": { - "collectorName": { - "type": "string" - }, - "exclude": { - "description": "BoolOrString is a type that can hold an bool or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a booolean string or raw bool.", - "oneOf": [{"type": "string"},{"type": "boolean"}] - }, - "namespace": { - "type": "string" - }, - "nodeSelector": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "timeout": { - "type": "string" - } - } - }, "logs": { "type": "object", "required": [ @@ -2096,6 +2133,53 @@ } } } + }, + "sysctl": { + "type": "object", + "required": [ + "image", + "namespace" + ], + "properties": { + "collectorName": { + "type": "string" + }, + "exclude": { + "oneOf": [{"type": "string"},{"type": "boolean"}] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "type": "string" + }, + "imagePullSecret": { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "timeout": { + "type": "string" + } + } } } }