Merge pull request #457 from replicatedhq/divolgin/pod-logs

Include pod logs for pods that are failing
This commit is contained in:
divolgin
2021-10-25 17:18:32 -07:00
committed by GitHub
12 changed files with 2843 additions and 1094 deletions
@@ -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:
@@ -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
File diff suppressed because it is too large Load Diff
@@ -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
+340
View File
@@ -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:
+329 -507
View File
@@ -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:
@@ -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
+28 -3
View File
@@ -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) {
@@ -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": [
+47 -27
View File
@@ -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"
}
}
}
}
}
+472 -27
View File
@@ -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"}]
}
}
}
}
}
+111 -27
View File
@@ -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"
}
}
}
}
}