* feat: add velero analyzer (#806)
* updated schema
* analyzer without collector
* tests
* covers deprecated Restic repository type
* velero version from deployment image to check deprecated type
* read for both velero pod kinds (velero*, node-agent*)
---------
Signed-off-by: Archit Sharma <archit@pm.me>
* gracefully handle unreachable URIs in loadSupportBundleSpecsFromURIs
* let caller decide how to handle the error
* fix klog import
* Add a test to ensure failing to load uri does not error
---------
Co-authored-by: Evans Mungai <evans@replicated.com>
If troubleshoot is used as a dependency in go.mod, the version
information of the release would be missing at runtime. This is
because the version string is injected to binaries at build time
using linker flags (LD) passed to the compiler (check Makefile)
* Add dry-run flag
* No traces on dry run
* More refactoring
* More updates to support bundle binary
* More refactoring changes
* Different approach of loading specs from URIs
* Self review
* More changes after review and testing
* fix how we parse oci image uri
* Remove unnecessary comment
* Add missing file
* Fix failing tests
* Better error check for no collectors
* Add default collectors when parsing support bundle specs
* Add missed test fixture
* Download specs with correct headers
* Fix typo
* stashing changes
* split filesystem collector into fio and legacy functions
* read fio results into analyzer
* remove test script
* update go.mod
* remove old notes
* go mod tidy
* fix up go.mod
* fix up go.mod
* refactor tests for fio
* make schemas
* remove local scripts
* local watch script for building troubleshoot
* document watch script
* fix var names
* handle errors if run as non-root
* go mod tidy
* use String interface
* collector happy path test
* invalid filesize
* invalid filesize
* tests
* remove old code
* remove old init function
* let actions tests run this
* clean up tests
* go mod tidy
* remove duplicated type declaration
* remove old file create code
* Document additional go tool profiling flags
* Add a regex cache to avoid compiling regular expressions all the time
* Reduce max buffer capacity
* Prefer bytes to strings
Strings are immutable and hence we need to create a new one
all the time when operation on them
* Some more changes
* More bytes
* Use writer.Write instead of fmt.FPrintf
* Clear regex cache when resetting redactors
* Logs errors when redactors error since they get swallowed
* Add an improvement comment
* Limit the number of goroutines spawned when redacting
* Minor improvement
* Write byte slices one at a time instead of concatenating them first
* Add a test for writeBytes
* Additional tests
* chore: make specs an internal package
* Some minor improvements
* Use LoadClusterSpecs in support bundle implementation
* Remove change accidentally committed
* Use LoadFromCLIArgs in preflight CLI implementation
* Update comment
* Fix edge case where the label selector is an empty string
* Fix failing test
* feat: Add Strict flag to LoadSpecs API
Strict flag which can be used to toggle between true
(raising errors if a document is invalid)
and false (ignoring invalid documents, perhaps logging a warning).
* Granular error handling multidocs in secrets and configmaps
* Fix failing test
* feat: Add regular expressions host anaylser
This anaylser is the same as the in-cluster text anaylser. You pass in
search expressions to find values in files collected in a bundle
* additional test assertion to check analyser warn
This adds JSONPath support to the json compare analyzer using
k8s.io/client-go/util/jsonpath implementation.
To preserve backwards compatibility a new attribute, `JsonPath, is added
to the compare analyzer as opposed to changing how `Path` works. Only
one should be set, but preference is given to `Path`, again to maintain
backwards compatibility.
As a convience for users, if the result of running the JSONPath
expression returns a single value, that value is unwrapped from its
enclosing array and used as the comparison with `Value`. This isn't
strictly compatible with how JSONPath works (all results are wrapped in
an array), but it's easier for end users who are expecting a single
result from their JSONPath expression.
* feat: add loader APIs to load specs from a list of yaml docs
The change introduces a loader package that will contain loader
public APIs. The aim of these APIs will be to, given any source of
troubleshoot specs, the loaders will fetch the specs and parse out
all troubleshoot objects that can be extracted.
* Some refactoring
* Some more changes
* More changes caught when testing vendor portal
* Add tests and rename Troubleshoot kinds struct
* Additional test
* Handle ConfigMap and Secrets with multiple specs in them
* Fix failing test
* Revert multidoc split implementation
* Fix merge conflict
* Change LoadFromXXX functions to a single LoadSpecs function
* ignore some more stuff
* watchrsync make command like kurl project
* document watchrsync
* the actual watchrsync script
* dont need these for npm dependencies
* Revert "dont need these for npm dependencies"
This reverts commit bdb4e62c38.
* install gaze-run-interrupt with make
* watchrsync instructions
* similar to the textAnalyze analyzer, adds support to evaluate the value at the specified yamlPath with regex or regexGroups
* fixes a typo in the shorthand name used for searching for cluster resource PVC objects
* we can now read preflight specs out of secrets, either from stdin or file input
* moved spec read logic out into its own function so it can be unit
tested easier
* added more comprehensive unit testing on the different ways we can read in specs
* only process when conditional if specified
* adding tests for cluster pod status analyzer
* use klog instead of fmt for logging
* add additional tests for warn and more operators
---------
Co-authored-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
* Boiler plate for host copy collector
* feat: Add copy host collector
* Add tests
* No need to handle symlinks in a special way
System libraries (os.ReadAll, os.ReadDir) already handle symlinks
* fix: Discover specs from namespaces user is allowed
If a user has limited access to read secrets and config maps
from certain namespaces in a cluster, we'd need to gracefully
fail when forbidden errors are caught. We'll log them and continue
searching for specs in other namespaces.
The fetch-depth parameter to the checkout action will provide a full
checkout instead of a shallow one that only has the last commit. Using
this makes the workflow files a bit more concise and removes an extra
step.
* Add arm to GOARCHes in .goreleaser.yaml and exclude the windows/arm
build
* Add arm/linux to goreleaser-test GitHub workflow job
* Add the linux/arm binaries to krew plugin manifests
Currently, there's no debug logs whatsoever when running a command like
troubleshoot --debug --interactive=false
Tackle this by printing similar log statements as presented in
interactive mode to the debug logger. Refactor the code a bit so there's
no need for a dedicated finished channel and to exit the goroutines
properly.
Co-authored-by: Evans Mungai <evans@replicated.com>
The which binary is used to detect if client-gen is installed, and if
it's not, the Makefile will install it. The initial detection prints
an error if it's not found. This is misleading, as it is actually an
expected situation.
When running a support bundle, we want to know how long each operation
(collect, redact, analyze) takes. This commit adds a new trace exporter
that records the start and end times of each operation, and then prints
a summary of the execution. The summary is also stored in the support
bundle.
Related to #923
Have all in-cluster analysers implement the same interface. This
will help with the implementation of code that requires making
calls to all analysers
Fixes#995
* adding dedup for in cluster collectors
* add tests
* return collector as is whenever marshalling to json fails
---------
Co-authored-by: Evans Mungai <evans@replicated.com>
* adding test coverage for preflight.RunPreflights()
TDD to work on https://github.com/replicatedhq/troubleshoot/issues/906
and verify the fix is successful
* go.mod/go.sum: removing gnomock stuff since it's not in use (yet)
* Makefile: try running the preflight integration test with the e2e tests,
since there's a K3s instance in place already
* Makefile add a dedicated test-integration task, which runs as it's own
github action job
* Makefile: exclude a few things from test-integration that break the
github action job
* WIP on preflight tests, addressing some of @banjoh's feedback, more to
go though (specifically changing over to using assert)
* preflight tests: use the testify libraries, restructure code to be
formatted more like other tests in this project
introduces a new option to limit the size of a pod log when added to the bundle. This will make sure the support bundle will not grow to an unacceptable size and thus might contain information that is too old.
The maximum size of a pod log in a bundle is set by default to 5MB, and can be changed if we decide upon the need.
BREAKING CHANGE: any logs that are collected by the logs collector are now limited by default to 5MB unless a different size limit is specified. Folks expecting log files larger than that to be collected without truncation will need to adjust their support bundle specs.
Fixes: #878
Allow collecting of CPU and memory diagnostics when running troubleshoot CLI applications using --memprofile and --cpuprofile flags. These flags accept file paths if where to store the collected runtime data
* feat(redactors): Run redactors on an existing support bundle
Add redact subcommand to support-bundle to allow running redactors on an
existing bundle to creating a new redacted bundle.
The command will be launched like so
support-bundle redact <redactor urls> --bundle support-bundle.tar.gz
Fixes: #705
* github build-test-deploy workflow: split goreleaser-test into 3 actions,
one for each ID/component (sharing a single config file)
rationale: speeding up github actions, goreleaser-test was taking
12-14mins and is the outlier longest to execute right now on this repo
* Revert "gitlab build-test-deploy workflow: split goreleaser-test into 3 actions,"
This reverts commit 61083dbbb8.
* github build-test-deploy workflow: split into 6 actions, divided by
GOARCH/GOOS
rationale: improve performance of checks on PR's
* .goreleaser.yaml - add a breadcrumb to ensure we keep the action jobs
list aligned
* filter on cpu architecture
* filter by cpu architecture
* fail if we dont have a label match too
* add tests for cpu arch filter
* update for make schemas
* First draft of a generic cluster-resource analyzer
* Add more resource mappings
* Support some cluster-scoped resources
the structure of this could probably be a bit tidyer, but this now
allows us to target non-namespaced resources simply by not specifying
the namespace in the analyzer.
* General tidy up
* pull resource selection into it's own function
* remove pointless pointer to string
* Export findResource function
This lets other analyzers use it.
* Add tests for cluster resources analyzer
* Update schemas
* Address some of @banjoh's comments
* rework resource selection
thanks @banjoh
* Replace FindFiles with GetFile
Since we already know where we're looking for files,
it doesn't make sense to have to loop over a single item slice.
* Use assert instead of require
* format
* Change default behaviour for no namespace
Now not providing a namespace causes us to default to "default", with an
explicit bool to toggle cluster-scoped resource checking.
This should feel somewhat more intuitive when writing analyzers that use
this function
* Generate schemas
* Value → expectedValue
To keep both the Support Bundle and Preflight CLIs similar, this PR adds the ability for the Preflight binary to allow multiple specs be provided as CLI args and for them all to be run.
The symlinking logs feature led to a regression where symlinks of
unhealthy pods were overwritting logs in the support bundle. This
fix allows the cluster resources collector to instruct the logs
collector not to symlink logs, which in turn ensures logs are not
overwritten.
Fixes: #908
* add dedup for cluster resources collector
* restructure both collect.go in both pkg/supportbundle and pkg/preflight to be more similar for eventual refactor
For a postgres collector spec targeting a server configured to accept
(m)TLS connections we need to pass in the necessary parameters in order
to successfully connect to the server. Both preflight and support bundle
specs use this collector.
This change allows us to pass in the necessary TLS parameters via inlined
TLS configuration or via a secret reference.
Fixes#747
This change removes the IPv4 address redaction which previously ran by default on all
support bundle collections.
Folks that want to redact IPv4 addresses will need to add that redactor manually to their redactor specs.
feat(collectors): Add mTLS parameters to the redis collector
For a redis collector spec targeting a redis server configured to accept
(m)TLS connections we need to pass in the necessary TLS parameters in order
to successfully connect to the server. Both preflight and support bundle
specs use this collector.
This change allows us to pass in the necessary TLS parameters via inlined
TLS configuration or via a secret reference.
Fixes#746
TL;DR
-----
Updates Sysctl collector and analyzer for virtual memory parameters
Details
-------
Adds supoort for virtual memory parameters to the Sysctl collector and
analyzers. I uncovered this writing a pre-flight for a Helm chart that
includes ECK as a subchart. Since ECK requires a specific minimum value
for `vm.max_map_count` I wanted to use the Sysctl analyzer to check for
the expected value, but wasn't able to because of the limited values it
collected. I also learned that Sonarqube expects the same parameter to
be increased, so it seemed like a general enough requirement to add it
in.
The code updates the collector to collect values under `/proc/sys/vm`
and adds tests to the analyzer to based on the ECK requirements. Making
the tests pass required adding operators to the when expression, since
the existing code only allowed for `=`, `==`, and `===`. The when
expression now supports `>`, `<`, `>=`, and `<=`.
All tests pass.
* feat(analyze): add ExcludeFiles field to textAnazlye
* feat(analyze): fix test for getFiles
* feat(analyze): change function name to excludeFilePaths
* feat(analyze): fix preflight test fail
* feat(analyze): add tests for excludeFiles
* feat(schemas): run make schemas
* feat(analyze): use getChildCollectedFileContents function prototype
* feat(analyze): reduce time complexity
* feat(longhorn): add getFileContents as getCollectedFileContents
* feat(collectors): Store all pod logs in cluster-resources directory
All pod logs collected by the logs collector will now be stored in
/cluster-resources/pods/logs/[namespace]/[pod]/[container].log. This
will provide consistency and allow sbctl to find the logs when we run
`kubectl logs <pod>`. To allow backwards compatibility, symlinks of the
log files will be created in the current expected locations.
Closes: #744
* fix(flag): fix wrong output filename
* fix(flag): add reset flag function
* fix(flag): add output flag test cases
* fix(flag): move resetFlags function into private go test
* fix(flag): restructure flag tests with testify
* fix(flag): remove resetFlags function
* fix(flag): remove duplicated test and rewrite test names
## Description:
Currently, when we install an k8s with kurl and we run kubectl preflight https://preflight.replicated.com it will fail:
> ------------
> Check FAIL
> Title: Ingress
> Message: Contour ingress not found!
Therefore, Contour ingress does not seems a pre-requirement to kURL. So, should we have this check in the default example/test?
This change ensures that the clusterResources collector runs prior to any others
in order to not collect info on pods that collectors run during collection.
Additionally centralizes functions that are common to all collection to make future
maintenance simpler.
Fixes: #767
Due to deprecation of the API at `policy/v1beta1` for `PodDisruptionBudgets` and `batch/v1beta1` for `CronJobs`, updated cluster_resources.go to accommodate using either apiVersion v1 & v1beta1
Add --follow-uri flag to support-bundle to ignore the uri field when set in a spec
Implement the new CLI flag in `root.go` so we can pass it if we need to ignore the `uri` field in a spec. This also serves as a minimal documentation effort when running `support-bundle --help`.
Fixes: #695
When troubleshooting an issue we want to see and check the `PodDisruptionBudget` for any application. As we currently do not have that 'standard' output in our support bundle, this PR serves as an implementation of providing one with an overview of `PodDisruptionBudget` on a per-namespace basis.
After creating a support bundle, the output can be reviewed by checking out `../cluster-resources/pdb/*.json`
- [Release notes](https://github.com/google/periph/releases)
updated-dependencies:
- dependency-name: periph.io/x/periph
dependency-type: direct:production
update-type: version-update:semver-minor
Module periph.io/x/periph has moved from 3.6.8 to re-arrange locations
in 3.7.2. This reworks to take advantage of the new format.
* Add Mysql variables to collector
* Cleanup row scanning and a few updates based on feedback
* Close db connection
* Move defer db.close
* Updates based on feedback
* Use vars in loop instead of struct
* Only pull parameters specified in collector config
Co-authored-by: Ethan Mosbaugh <ethan@replicated.com>
* fix: return true when one of analyzers is true
* fix: return true when one of analyzers is true
* update: add unit test
* update: log errors while processing analyzers
* fix: return parse error instead of logging
* fix: update err message
* fix: evaluate strict check err separately
* add strict flag to Analyzer/AnalyzerMeta
and regenerate schemas and controller-gen code
* map analyzer strict to result
* Update stdout for human and json format
* fix review comment
* update interactive result
* update interactive results
* Update types.go
* Update upload_results.go
* print strict when only true
* collector/analyzer for host operating system
* address cr comments
* cleanup
* fix invoking the analyzer
code cleanup
* fix cr comments
* add corner case unit-test
* fix kernel version parsing
* address review comments
* add default case
* parse using regex
* added more testcases and fixed the bug found in cr
* few small things
* Add collect command and remote host collectors
Adds the ability to run a host collector on a set of remote k8s nodes.
Target nodes can be filtered using the --selector flag, with the same
syntax as kubectl. Existing flags for --collector-image,
--collector-pullpolicy and --request-timeout are used. To run on a
specified node, --selector="kubernetes.io/hostname=kind-worker2" could
be used.
The collect command is used by the remote collector to output the
results using a "raw" format, which uses the filename as the key, and
the value the output as a escaped json string. When run manually it
defaults to fully decoded json. The existing block devices,
ipv4interfaces and services host collectors don't decode properly - the
fix is to convert their slice output to a map (fix not included as
unsure what depends on the existing format).
The collect command is also useful for troubleshooting preflight issues.
Examples are included to show remote collector usage.
```
bin/collect --collector-image=croomes/troubleshoot:latest examples/collect/remote/memory.yaml --namespace test
{
"kind-control-plane": {
"system/memory.json": {
"total": 1304207360
}
},
"kind-worker": {
"system/memory.json": {
"total": 1695780864
}
},
"kind-worker2": {
"system/memory.json": {
"total": 1726353408
}
}
}
```
The preflight command has been updated to run remote collectors. To run
a host collector remotely it must be specified in the spec as a
`remoteCollector`:
```
apiVersion: troubleshoot.sh/v1beta2
kind: HostPreflight
metadata:
name: memory
spec:
remoteCollectors:
- memory:
collectorName: memory
analyzers:
- memory:
outcomes:
- fail:
when: "< 8Gi"
message: At least 8Gi of memory is required
- warn:
when: "< 32Gi"
message: At least 32Gi of memory is recommended
- pass:
message: The system has as sufficient memory
```
Results for each node are analyzed separately, with the node name
appended to the title:
```
bin/preflight --interactive=false --collector-image=croomes/troubleshoot:latest examples/preflight/remote/memory.yaml --format=json
{memory running 0 1}
{memory completed 1 1}
{
"fail": [
{
"title": "Amount of Memory (kind-worker2)",
"message": "At least 8Gi of memory is required"
},
{
"title": "Amount of Memory (kind-worker)",
"message": "At least 8Gi of memory is required"
},
{
"title": "Amount of Memory (kind-control-plane)",
"message": "At least 8Gi of memory is required"
}
]
}
```
Also added a host collector to allow preflight checks of required kernel
modules, which is the main driver for this change.
* add an unique id to each host preflights
* auto generated files
* updated schemas for the new field id
* keeping it consistent with the rest of the spec
when using the `interactive=false` flag of `support-bundle`, the spinner would still spin and the archive path and analysis output were kind of smooshed together with the logs.
now, if `interactive=false`, only print each recieved collector callback message once, and don't spin
also, add a key to the archivePath and analyzerOutput that are returned, for easier programatic parsing
The IPAM pool analyzer checks that utilization of the pod IP subnet is
less than 85%. For example, if using 10.32.0.0/12, this analyzer will
warn if 3,482 IPs are currently allocated to pods.
The pending allocation analyzer checks that the IPAM status in the
report has no items for the PendingAllocates field. This indicates the
IPAM service is not ready according to the code in the weave status
template
https://github.com/weaveworks/weave/blob/e3712152d2a0fe3bc998964c948e45bdf8ff6144/prog/weaver/http.go#L186.
The weave connections analyzer checks that all connections to remote
peers are in the established state. The state will be "pending" if UDP
is blocked between nodes and will be "failed" if the weave pod on the
remote node is in a crash loop. To force a pending state for testing,
run the commands `iptables -A INPUT -p udp --dport 6784 -j REJECT` and
`iptables -A INPUT -p udp --dport 6783 -j REJECT` on a peer.
The weave connections analyzer also checks that all connections are
using the fastdp protocol. A commopn issue seen in the field on
CentOS/RHEL 7 is that some sides of a connection are using fastdp and
other sides have fallen back to sleeve. Set the WEAVE_NO_FASTDP env var
on the weave daemonset to "true" to test this analyzer.
Fixed bug caused by host preflights not handling empty when clauses, this cropped up because we now handle multiple host preflight results. Also expanded test coverage and added integration test script.
Add a background IOPS feature to the filesystem performance collector
that specifies separate read and write background IOPS to perform while
measuring latency. This allows for better assessment of whether etcd
will be stable when running alongside other workloads on the same
cluster.
Also add templating to the outcome message of the filesystem performance
analyzers to allow printing individual latency percentiles or the entire
table.
Remove the random IOPS benchmark since it was attempting to perform
unaligned direct I/O.
The random IOPS benchmark attempts to replicate the results of this
fio command:
fio --ioengine=psync --direct=1 --bs=4k --size=1Gi --readwrite=randread --serialize_overlap=1
Across three tests the fio command reported 1877 IOPS and the preflight
1822 IOPS with the same block and file size.
The included example found P99 latency of 2.6ms.
Fio reported P99 latency of 2.5ms with this command:
fio --rw=write --ioengine=sync --fdatasync=1 --directory=/var/lib/etcd
--size=220m --bs=2300
Add all supported analyzers to host preflight sample.
Don't log transient errors waiting for TCP connection.
Begin human stdout results on new line after spinner.
Fixes `sum(memoryAllocatable)` and `sum(podAllocatable)`. These
previously tested the wrong resource (cpuAllocatable).
Also refactor comparison functions to unify resolving properties and add
more testing.
Fixes#179.
Remove repetition across test cases that made it hard to read. Tweaks
tests where needed so they can all use the same node data. Also corrects
a test where the description didn't match the test.
add redact type, and begin wiring global redactors
use per-collector redactors
add a test of the 'data' collector and redaction
handle literal string replacements
remove redundant types and redact calls
add proper redactor type, foundations of global redactors
accept global redactors from the CLI, include sample redaction spec
This commit includes the following changes:
1. Updated to allow a analyze spec from URL
2. Removed spec flag
The analyzer spec is a positional argument consistent with preflight.
that file was not collected in v0.9.15 and earlier, so we shouldn't require it - particularly since the microk8s/dockerdesktop/eks/gke/DO detection doesn't depend on it
also run cluster-resources collector even when some rbac permissions are missing
print progress message when skipping a collector due to rbac issues
include a sample troubleshoot yaml spec in the repo
Most of the code here is borrowed from this [Microsoft repo of base images](https://github.com/microsoft/vscode-dev-containers), except for replicated specific things.
## Notes
* k3d *DOES NOT* work with DinD. You have to use the docker with docker install instead.
* Might be faster to install kubectl plugins on the `$PATH` in the `Dockerfile` instead of downloading them `onCreate.sh`.
if [ -z "$(git config --get core.editor)" ] && [ -z "${GIT_EDITOR}" ]; then
if [ "${TERM_PROGRAM}" = "vscode" ]; then
if [[ -n $(command -v code-insiders) && -z $(command -v code) ]]; then
export GIT_EDITOR="code-insiders --wait"
else
export GIT_EDITOR="code --wait"
fi
fi
fi
EOF
)"
# code shim, it fallbacks to code-insiders if code is not available
cat << 'EOF' > /usr/local/bin/code
#!/bin/sh
get_in_path_except_current() {
which -a "$1" | grep -A1 "$0" | grep -v "$0"
}
code="$(get_in_path_except_current code)"
if [ -n "$code" ]; then
exec "$code" "$@"
elif [ "$(command -v code-insiders)" ]; then
exec code-insiders "$@"
else
echo "code or code-insiders is not installed" >&2
exit 127
fi
EOF
chmod +x /usr/local/bin/code
# systemctl shim - tells people to use 'service' if systemd is not running
cat << 'EOF' > /usr/local/bin/systemctl
#!/bin/sh
set -e
if [ -d "/run/systemd/system" ]; then
exec /bin/systemctl/systemctl "$@"
else
echo '\n"systemd" is not running in this container due to its overhead.\nUse the "service" command to start services intead. e.g.: \n\nservice --status-all'
fi
EOF
chmod +x /usr/local/bin/systemctl
# Codespaces bash and OMZ themes - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
echo -e '\n(*) Warning: The docker command was not found.\n\nYou can use one of the following scripts to install it:\n\nhttps://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker-in-docker.md\n\nor\n\nhttps://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md'
echo -e "\nForward port ${SSHD_PORT} to your local machine and run:\n\n ssh -p ${SSHD_PORT} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null ${USERNAME}@localhost\n"
Include a description of the expected behaviour here.
**Steps To Reproduce**
Include the commands to reproduce the issue including any output. Any information that will help us to understand the problem is useful. Feel free to paste long output into a [Github gist](https://gist.github.com) and include the link here.
**Additional Context**
Include the following information.
- Troubleshoot version. If you built from source, note that including the version of Go you used to build with.
- Operating system
- Operating system version
- Other details that might be helpful in diagnosing the problem
about:Create a tracking issue for a change that is larger than a single task
labels:'epic'
---
# Design Proposal
Link to the [proposal](https://github.com/replicatedhq/troubleshoot/tree/main/design/template.md)
# Definition of done
Describe what specific goals can measure if this overall task is considered completed. Things to consider are documentation, high level description of the feature working, and tests.
* [ ]
# Subtasks
Create a list of the smaller tasks to implement this design. Task can start as simple descriptions but should be converted to issues before work is started.
**Describe the rationale for the suggested feature.**
Insert a description of the rationale for the new feature here. For example, you could describe a problem that Troubleshoot doesn't address, a limitation, or an idea to improve Troubleshoot.
**Describe the feature**
Insert a description of the feature here. Be specific about how it addresses the problem. Mention any limitations, or suggested improvements outlined in the rationale for the feature.
**Describe alternatives you've considered**
Describe alternative solutions here. Include any workarounds you've considered.
**Additional context**
Add additional context about the feature request. If the change is substantial, consider attaching files to the issue outlining architectural changes, data flows, file formats etc., anything that helps describe the requested change.
Please include a summary of the change or what problem it solves. Please also include relevant motivation and context.
<!--- If it relates to an open issue, please link to the issue here.
e.g.
Fixes: #414
-->
## Checklist
- [ ] New and existing tests pass locally with introduced changes.
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] The commit message(s) are informative and highlight any breaking changes
- [ ] Any documentation required has been added/updated. For changes to https://troubleshoot.sh/ create a PR [here](https://github.com/replicatedhq/troubleshoot.sh/pulls)
## Does this PR introduce a breaking change?
- [ ] Yes
- [ ] No
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
Thank you for your interest in Troubleshoot, we welcome your participation. Please familiarize yourself with our [Code of Conduct](https://github.com/replicatedhq/troubleshoot/blob/main/CODE_OF_CONDUCT.md) prior to contributing. There are a number of ways to participate in Troubleshoot as outlined below:
# Community
For discussions about developing Troubleshoot, there's an [#app-troubleshoot channel in Kubernetes Slack](https://kubernetes.slack.com/channels/app-troubleshoot), plus IRC using [Libera](ircs://irc.libera.chat:6697/#troubleshoot) (#troubleshoot).
There are [community meetings](https://calendar.google.com/calendar/u/0?cid=Y19mMGx1aGhiZGtscGllOGo5dWpicXMwNnN1a0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t) on a regular basis, with a shared calendar and [public notes](https://hackmd.io/yZbotEHdTg6TfRZBzb8Tcg)
## Issues
- [Request a New Feature](https://github.com/replicatedhq/troubleshoot/issues/new?assignees=&labels=feature&template=feature_enhancement.md) Create an issue to add functionality that addresses a problem or adds an enhancement.
- [Report a Bug](https://github.com/replicatedhq/troubleshoot/issues/new?assignees=&labels=bug&template=bug_report.md) Report a problem or unexpected behaviour with Troubleshoot.
## Design Principles
When implementing a new feature please review the [design principles](./docs/design/design-principles.md) to help guide the approach.
## Development Environment
To get started we recommend:
1. Go (v1.20 or later)
2. A Kubernetes cluster (we recommend <https://k3d.io/>. This requires Docker v20.10.5 or later)
3. Fork and clone the repo to $GOPATH/src/github.com/replicatedhq/
4. Run `make support-bundle preflight` to generate binaries
5. Run `make run-troubleshoot` to generate a support bundle with the `sample-troubleshoot.yaml` in the root of the repo
> Note: recent versions of Go support easy cross-compilation. For example, to cross-compile a Linux binary from MacOS:
> `GOOS=linux GOARCH=amd64 make support-bundle preflight`
6. Install [golangci-lint] linter and run `make lint` to execute additional code linters.
### Build automatically on save with `watch`
1. Install `npm`
2. Run `make watch` to build binaries automatically on saving. Note: you may still have to run `make schemas` if you've added API changes, like a new collector or analyzer type.
### Syncing to a test cluster with `watchrsync`
1. Install `npm`
2. Export `REMOTES=<user>@<ip>` so that `watchrsync` knows where to sync.
3. Maybe run `export GOOS=linux` and `export GOARCH=amd64` so that you build Linux binaries.
4. run `make watchrsync` to build and sync binaries automatically on saving.
A running Kubernetes cluster as well as `jq` are required to run e2e tests.
### Profiling
You are able to collect CPU & memory runtime properties and store the data for analysis in a file. To do so, pass in the file paths using `--cpuprofile` and `--memprofile` flags in the CLI. Once you have your data collected, you can analyse it using [pprof visualization tool](https://github.com/google/pprof/blob/main/doc/README.md). Here is how
Run support bundle and with CPU & memory profile flags
- Push your changes to a topic branch in your fork of the repository.
- Submit a pull request to the original repository. It will be reviewed in a timely manner.
### Pull Requests
A pull request should address a single issue, feature or bug. For example, lets say you've written code that fixes two issues. That's great! However, you should submit two small pull requests, one for each issue as opposed to combining them into a single larger pull request. In general the size of the pull request should be kept small in order to make it easy for a reviewer to understand, and to minimize risks from integrating many changes at the same time. For example, if you are working on a large feature you should break it into several smaller PRs by implementing the feature as changes to several packages and submitting a separate pull request for each one. Squash commit history when preparing your PR so it merges as 1 commit.
Code submitted in pull requests must be properly documented, formatted and tested in order to be approved and merged. The following guidelines describe the things a reviewer will look for when they evaluate your pull request. Here's a tip. If your reviewer doesn't understand what the code is doing, they won't approve the pull request. Strive to make code clear and well documented. If possible, request a reviewer that has some context on the PR.
### Commit messages
Commit messages should follow the general guidelines:
- Breaking changes should be highlighted in the heading of the commit message.
- Commits should be clear about their purpose (and a single commit per thing that changed)
- Messages should be descriptive:
- First line, 50 chars or less, as a heading/title that people can find
- Then a paragraph explaining things
- Consider a footer with links to which bugs they fix etc, bearing in mind that Github does some of this magic already
cd longhorn-manager && git checkout v1.2.2 &&cd ..
rm -rf pkg/longhorn
mv longhorn-manager/k8s/pkg pkg/longhorn
mv longhorn-manager/types pkg/longhorn/types
mv longhorn-manager/util pkg/longhorn/util
rm -rf pkg/longhorn/util/daemon
rm -rf pkg/longhorn/util/server
find pkg/longhorn -type f | xargs sed -i "s/github.com\/longhorn\/longhorn-manager\/k8s\/pkg/github.com\/replicatedhq\/troubleshoot\/pkg\/longhorn/g"
find pkg/longhorn -type f | xargs sed -i "s/github.com\/longhorn\/longhorn-manager\/types/github.com\/replicatedhq\/troubleshoot\/pkg\/longhorn\/types/g"
find pkg/longhorn -type f | xargs sed -i "s/github.com\/longhorn\/longhorn-manager\/util/github.com\/replicatedhq\/troubleshoot\/pkg\/longhorn\/util/g"
rm -rf longhorn-manager
.PHONY:scan
scan:
trivy fs \
--scanners vuln \
--exit-code=1\
--severity="HIGH,CRITICAL"\
--ignore-unfixed \
./
.PHONY:lint
lint:fmtvet
golangci-lint run --new -c .golangci.yaml ${BUILDPATHS}
.PHONY:lint-and-fix
lint-and-fix:fmtvet
golangci-lint run --new --fix -c .golangci.yaml ${BUILDPATHS}
.PHONY:watch
watch:npm-install
bin/watch.js
## Syncronize the code with a remote server. More info: CONTRIBUTING.md
.PHONY:watchrsync
watchrsync:npm-install
bin/watchrsync.js
.PHONY:npm-install
npm-install:
npm --version 2>&1 >/dev/null ||(echo"npm not installed; install npm to set up watchrsync"&&exit1)
npm list gaze-run-interrupt || npm install install --no-save gaze-run-interrupt@~2.0.0
Replicated Troubleshoot is a CLI tool that provides pre-installation cluster conformance testing and validation (preflight checks) and post-installation troubleshooting and diagnostics (support bundles).
Replicated Troubleshoot is a framework for collecting, redacting, and analyzing highly customizable diagnostic information about a Kubernetes cluster. Troubleshoot specs are created by 3rd-party application developers/maintainers and run by cluster operators in the initial and ongoing operation of those applications.
Troubleshoot provides two CLI tools as kubectl plugins (using [Krew](https://krew.dev)): `kubectl preflight` and `kubectl support-bundle`. Preflight provides pre-installation cluster conformance testing and validation (preflight checks) and support-bundle provides post-installation troubleshooting and diagnostics (support bundles).
To know more about troubleshoot, please visit: https://troubleshoot.sh/
## Preflight Checks
Preflight checks are an easy-to-run set of conformance tests that can be written to verify that specific requirements in a cluster are met.
To run a sample preflight check from a sample application, [install the preflight kubectl plugin](https://help.replicated.com/docs/troubleshoot/kubernetes/preflight/executing/) and run:
To run a sample preflight check from a sample application, install the preflight kubectl plugin:
```shell
```
curl https://krew.sh/preflight | bash
```
and run, where https://preflight.replicated.com provides an **example** preflight spec:
For a full description of the supported preflight checks, visit the [docs](https://help.replicated.com/docs/troubleshoot/kubernetes/analysis/).
**NOTE** this is an example. Do **not** use to validate real scenarios.
For more details on creating the custom resource files that drive preflight checks, visit [creating preflight checks](https://troubleshoot.sh/docs/preflight/introduction/).
## Support Bundle
A support bundle is an archive that's created in-cluster, by collecting logs, cluster information and executing various commands. After creating a support bundle, the cluster operator will normally deliver it to the application vendor for analysis and remote debugging.
A support bundle is an archive that's created in-cluster, by collecting logs and cluster information, and executing specified commands (including redaction of sensitive information). After creating a support bundle, the cluster operator will normally deliver it to the 3rd-party application vendor for analysis and disconnected debugging. Another Replicated project, [KOTS](https://github.com/replicatedhq/kots), provides k8s apps an in-cluster UI for processing support bundles and viewing analyzers (as well as support bundle collection).
To collect a sample support bundle, [install the troubleshoot kubectl plugin](https://help.replicated.com/docs/troubleshoot/kubernetes/support-bundle/collecting/) and run:
To collect a sample support bundle, install the troubleshoot kubectl plugin:
**NOTE** this is an example. Do **not** use to validate real scenarios.
For more details on creating the custom resource files that drive support-bundle collection, visit [creating collectors](https://troubleshoot.sh/docs/collect/) and [creating analyzers](https://troubleshoot.sh/docs/analyze/).
And see our other tool [sbctl](https://github.com/replicatedhq/sbctl) that makes it easier to interact with support bundles using `kubectl` commands you already know
# Community
For questions about using Troubleshoot, how to contribute and engaging with the project in any other way, please refer to the following resources and channels.
- [Replicated Community](https://help.replicated.com/community) forum
- [#app-troubleshoot channel in Kubernetes Slack](https://kubernetes.slack.com/channels/app-troubleshoot)
- [#Community meetings calendar](https://calendar.google.com/calendar/u/0?cid=Y19mMGx1aGhiZGtscGllOGo5dWpicXMwNnN1a0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t). This happen monthly but dates may change and would be kept upto date in the calendar.
# Software Bill of Materials
A signed SBOM that includes Troubleshoot dependencies is included in each release.
- **troubleshoot-sbom.tgz** contains a software bill of materials for Troubleshoot.
- **troubleshoot-sbom.tgz.sig** is the digital signature for troubleshoot-sbom.tgz
- **key.pub** is the public key from the key pair used to sign troubleshoot-sbom.tgz
The following example illustrates using [cosign](https://github.com/sigstore/cosign) to verify that **troubleshoot-sbom.tgz** has
If you were to get an error similar to the one below, it means you are verifying an SBOM signed using cosign `v1` using a newer `v2` of the binary. This version introduced [breaking changes](https://github.com/sigstore/cosign/blob/main/CHANGELOG.md#breaking-changes) which require an additional flag `--insecure-ignore-tlog=true` to successfully verify SBOMs like so.
returnerrors.Wrap(err,"failed to create support bundle archive")
}
fmt.Println("Redacted support bundle:",output)
returnnil
},
}
cmd.Flags().String("bundle","","file path of the support bundle archive to redact")
cmd.MarkFlagRequired("bundle")
cmd.Flags().BoolP("quiet","q",false,"enable/disable error messaging and only show parseable output")
cmd.Flags().StringP("output","o","","file path of where to save the redacted support bundle archive (default \"redacted-support-bundle-YYYY-MM-DDTHH_MM_SS.tar.gz\")")
cmd.Flags().Bool("collect-without-permissions",true,"always generate a support bundle, even if it some require additional permissions")
cmd.Flags().StringSliceP("selector","l",[]string{"troubleshoot.sh/kind=support-bundle"},"selector to filter on for loading additional support bundle specs found in secrets within the cluster")
cmd.Flags().Bool("load-cluster-specs",false,"enable/disable loading additional troubleshoot specs found within the cluster. required when no specs are provided on the command line")
cmd.Flags().String("since-time","","force pod logs collectors to return logs after a specific date (RFC3339)")
cmd.Flags().String("since","","force pod logs collectors to return logs newer than a relative duration like 5s, 2m, or 3h.")
cmd.Flags().StringP("output","o","","specify the output file path for the support bundle")
cmd.Flags().Bool("debug",false,"enable debug logging. This is equivalent to --v=0")
cmd.Flags().Bool("dry-run",false,"print support bundle spec without collecting anything")
cmd.Flags().String("serviceaccount","","name of the service account to use. if not provided, one will be created")
viper.BindPFlags(cmd.Flags())
// hidden in favor of the `insecure-skip-tls-verify` flag
cmd.Flags().Bool("allow-insecure-connections",false,"when set, do not verify TLS certs when retrieving spec and reporting results")
description:AnalyzerJob is the Schema for the analyzerjobs 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:AnalyzerJobSpec defines the desired state of AnalyzerJob
type:object
status:
description:AnalyzerJobStatus defines the observed state of AnalyzerJob
type:object
type:object
version:v1beta1
versions:
- name:v1beta1
schema:
openAPIV3Schema:
description:AnalyzerJob is the Schema for the analyzerjobs 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/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/api-conventions.md#types-kinds'
type:string
metadata:
properties:
annotations:
additionalProperties:
type:string
description:'Annotations is an unstructured key value map stored
with a resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations'
type:object
clusterName:
description:The name of the cluster which the object belongs to.
This is used to distinguish resources with same name and namespace
in different clusters. This field is not set anywhere right now
and apiserver is going to ignore it if set in create or update request.
type:string
creationTimestamp:
description:"CreationTimestamp is a timestamp representing the server
time when this object was created. It is not guaranteed to be set
in happens-before order across separate operations. Clients may
not set this value. It is represented in RFC3339 form and is in
UTC. \n Populated by the system. Read-only. Null for lists. More
description:selfLink is a URL representing this object.
Populated by the system. Read-only.
type:string
type:object
reason:
description:A machine-readable description of why this operation
is in the "Failure" status. If this value is empty there
is no information available. A Reason clarifies an HTTP
status code but does not override it.
type:string
status:
description:'Status of the operation. One of:"Success"or
"Failure". More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status'
type:string
type:object
required:
- pending
type:object
labels:
additionalProperties:
type:string
description:'Map of string keys and values that can be used to organize
and categorize (scope and select) objects. May match selectors of
replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels'
type:object
managedFields:
description:"ManagedFields maps workflow-id and version to the set
of fields that are managed by that workflow. This is mostly for
internal housekeeping, and users typically shouldn't need to set
or understand this field. A workflow can be the user's name, a controller's
name, or the name of a specific apply path like \"ci-cd\". The set
of fields is always in the version that the workflow used when modifying
the object. \n This field is alpha and can be changed or removed
without notice."
items:
properties:
apiVersion:
description:APIVersion defines the version of this resource
that this field set applies to. The format is "group/version"
just like the top-level APIVersion field. It is necessary
to track the version of a field set because it cannot be automatically
converted.
type:string
fields:
additionalProperties:true
description:Fields identifies a set of fields.
type:object
manager:
description:Manager is an identifier of the workflow managing
these fields.
type:string
operation:
description:Operation is the type of operation which lead to
this ManagedFieldsEntry being created. The only valid values
for this field are 'Apply' and 'Update'.
type:string
time:
description:Time is timestamp of when these fields were set.
It should always be empty if Operation is 'Apply'
format:date-time
type:string
type:object
type:array
name:
description:'Name must be unique within a namespace. Is required
when creating resources, although some resources may allow a client
to request the generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
namespace:
description:"Namespace defines the space within each name must be
unique. An empty namespace is equivalent to the \"default\" namespace,
but \"default\" is the canonical representation. Not all objects
are required to be scoped to a namespace - the value of this field
for those objects will be empty. \n Must be a DNS_LABEL. Cannot
be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"
type:string
ownerReferences:
description:List of objects depended by this object. If ALL objects
in the list have been deleted, this object will be garbage collected.
If this object is managed by a controller, then an entry in this
list will point to this controller, with the controller field set
to true. There cannot be more than one managing controller.
items:
properties:
apiVersion:
description:API version of the referent.
type:string
blockOwnerDeletion:
description:If true, AND if the owner has the "foregroundDeletion"
finalizer, then the owner cannot be deleted from the key-value
store until this reference is removed. Defaults to false.
To set this field, a user needs "delete" permission of the
owner, otherwise 422 (Unprocessable Entity) will be returned.
type:boolean
controller:
description:If true, this reference points to the managing
controller.
type:boolean
kind:
description:'Kind of the referent. More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type:string
name:
description:'Name of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
uid:
description:'UID of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#uids'
type:string
required:
- apiVersion
- kind
- name
- uid
type:object
type:array
resourceVersion:
description:"An opaque value that represents the internal version
of this object that can be used by clients to determine when objects
have changed. May be used for optimistic concurrency, change detection,
and the watch operation on a resource or set of resources. Clients
must treat these values as opaque and passed unmodified back to
the server. They may only be valid for a particular resource or
set of resources. \n Populated by the system. Read-only. Value must
be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"
type:string
selfLink:
description:SelfLink is a URL representing this object. Populated
by the system. Read-only.
type:string
uid:
description:"UID is the unique in time and space value for this object.
It is typically generated by the server on successful creation of
a resource and is not allowed to change on PUT operations. \n Populated
by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
description:CollectorJob is the Schema for the collectorjobs 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:CollectorJobSpec defines the desired state of CollectorJob
properties:
collector:
properties:
name:
type:string
namespace:
type:string
required:
- name
type:object
image:
type:string
imagePullPolicy:
type:string
redact:
type:boolean
required:
- collector
type:object
status:
description:CollectorJobStatus defines the observed state of CollectorJob
properties:
failed:
items:
type:string
type:array
isServerReady:
type:boolean
running:
items:
type:string
type:array
serverPodName:
type:string
serverPodNamespace:
type:string
serverPodPort:
type:integer
successful:
items:
type:string
type:array
required:
- failed
- isServerReady
- running
- serverPodName
- serverPodNamespace
- serverPodPort
- successful
type:object
type:object
version:v1beta1
versions:
- name:v1beta1
schema:
openAPIV3Schema:
description:CollectorJob is the Schema for the collectorjobs 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/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/api-conventions.md#types-kinds'
type:string
metadata:
properties:
annotations:
additionalProperties:
type:string
description:'Annotations is an unstructured key value map stored
with a resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations'
type:object
clusterName:
description:The name of the cluster which the object belongs to.
This is used to distinguish resources with same name and namespace
in different clusters. This field is not set anywhere right now
and apiserver is going to ignore it if set in create or update request.
type:string
creationTimestamp:
description:"CreationTimestamp is a timestamp representing the server
time when this object was created. It is not guaranteed to be set
in happens-before order across separate operations. Clients may
not set this value. It is represented in RFC3339 form and is in
UTC. \n Populated by the system. Read-only. Null for lists. More
description:selfLink is a URL representing this object.
Populated by the system. Read-only.
type:string
type:object
reason:
description:A machine-readable description of why this operation
is in the "Failure" status. If this value is empty there
is no information available. A Reason clarifies an HTTP
status code but does not override it.
type:string
status:
description:'Status of the operation. One of:"Success"or
"Failure". More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status'
type:string
type:object
required:
- pending
type:object
labels:
additionalProperties:
type:string
description:'Map of string keys and values that can be used to organize
and categorize (scope and select) objects. May match selectors of
replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels'
type:object
managedFields:
description:"ManagedFields maps workflow-id and version to the set
of fields that are managed by that workflow. This is mostly for
internal housekeeping, and users typically shouldn't need to set
or understand this field. A workflow can be the user's name, a controller's
name, or the name of a specific apply path like \"ci-cd\". The set
of fields is always in the version that the workflow used when modifying
the object. \n This field is alpha and can be changed or removed
without notice."
items:
properties:
apiVersion:
description:APIVersion defines the version of this resource
that this field set applies to. The format is "group/version"
just like the top-level APIVersion field. It is necessary
to track the version of a field set because it cannot be automatically
converted.
type:string
fields:
additionalProperties:true
description:Fields identifies a set of fields.
type:object
manager:
description:Manager is an identifier of the workflow managing
these fields.
type:string
operation:
description:Operation is the type of operation which lead to
this ManagedFieldsEntry being created. The only valid values
for this field are 'Apply' and 'Update'.
type:string
time:
description:Time is timestamp of when these fields were set.
It should always be empty if Operation is 'Apply'
format:date-time
type:string
type:object
type:array
name:
description:'Name must be unique within a namespace. Is required
when creating resources, although some resources may allow a client
to request the generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
namespace:
description:"Namespace defines the space within each name must be
unique. An empty namespace is equivalent to the \"default\" namespace,
but \"default\" is the canonical representation. Not all objects
are required to be scoped to a namespace - the value of this field
for those objects will be empty. \n Must be a DNS_LABEL. Cannot
be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"
type:string
ownerReferences:
description:List of objects depended by this object. If ALL objects
in the list have been deleted, this object will be garbage collected.
If this object is managed by a controller, then an entry in this
list will point to this controller, with the controller field set
to true. There cannot be more than one managing controller.
items:
properties:
apiVersion:
description:API version of the referent.
type:string
blockOwnerDeletion:
description:If true, AND if the owner has the "foregroundDeletion"
finalizer, then the owner cannot be deleted from the key-value
store until this reference is removed. Defaults to false.
To set this field, a user needs "delete" permission of the
owner, otherwise 422 (Unprocessable Entity) will be returned.
type:boolean
controller:
description:If true, this reference points to the managing
controller.
type:boolean
kind:
description:'Kind of the referent. More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type:string
name:
description:'Name of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
uid:
description:'UID of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#uids'
type:string
required:
- apiVersion
- kind
- name
- uid
type:object
type:array
resourceVersion:
description:"An opaque value that represents the internal version
of this object that can be used by clients to determine when objects
have changed. May be used for optimistic concurrency, change detection,
and the watch operation on a resource or set of resources. Clients
must treat these values as opaque and passed unmodified back to
the server. They may only be valid for a particular resource or
set of resources. \n Populated by the system. Read-only. Value must
be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"
type:string
selfLink:
description:SelfLink is a URL representing this object. Populated
by the system. Read-only.
type:string
uid:
description:"UID is the unique in time and space value for this object.
It is typically generated by the server on successful creation of
a resource and is not allowed to change on PUT operations. \n Populated
by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
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/api-conventions.md#resources'
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/api-conventions.md#types-kinds'
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:
properties:
annotations:
additionalProperties:
type:string
description:'Annotations is an unstructured key value map stored
with a resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations'
type:object
clusterName:
description:The name of the cluster which the object belongs to.
This is used to distinguish resources with same name and namespace
in different clusters. This field is not set anywhere right now
and apiserver is going to ignore it if set in create or update request.
type:string
creationTimestamp:
description:"CreationTimestamp is a timestamp representing the server
time when this object was created. It is not guaranteed to be set
in happens-before order across separate operations. Clients may
not set this value. It is represented in RFC3339 form and is in
UTC. \n Populated by the system. Read-only. Null for lists. More
description:selfLink is a URL representing this object.
Populated by the system. Read-only.
type:string
type:object
reason:
description:A machine-readable description of why this operation
is in the "Failure" status. If this value is empty there
is no information available. A Reason clarifies an HTTP
status code but does not override it.
type:string
status:
description:'Status of the operation. One of:"Success"or
"Failure". More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status'
type:string
type:object
required:
- pending
type:object
labels:
additionalProperties:
type:string
description:'Map of string keys and values that can be used to organize
and categorize (scope and select) objects. May match selectors of
replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels'
type:object
managedFields:
description:"ManagedFields maps workflow-id and version to the set
of fields that are managed by that workflow. This is mostly for
internal housekeeping, and users typically shouldn't need to set
or understand this field. A workflow can be the user's name, a controller's
name, or the name of a specific apply path like \"ci-cd\". The set
of fields is always in the version that the workflow used when modifying
the object. \n This field is alpha and can be changed or removed
without notice."
items:
properties:
apiVersion:
description:APIVersion defines the version of this resource
that this field set applies to. The format is "group/version"
just like the top-level APIVersion field. It is necessary
to track the version of a field set because it cannot be automatically
converted.
type:string
fields:
additionalProperties:true
description:Fields identifies a set of fields.
type:object
manager:
description:Manager is an identifier of the workflow managing
these fields.
type:string
operation:
description:Operation is the type of operation which lead to
this ManagedFieldsEntry being created. The only valid values
for this field are 'Apply' and 'Update'.
type:string
time:
description:Time is timestamp of when these fields were set.
It should always be empty if Operation is 'Apply'
format:date-time
type:string
type:object
type:array
name:
description:'Name must be unique within a namespace. Is required
when creating resources, although some resources may allow a client
to request the generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
namespace:
description:"Namespace defines the space within each name must be
unique. An empty namespace is equivalent to the \"default\" namespace,
but \"default\" is the canonical representation. Not all objects
are required to be scoped to a namespace - the value of this field
for those objects will be empty. \n Must be a DNS_LABEL. Cannot
be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"
type:string
ownerReferences:
description:List of objects depended by this object. If ALL objects
in the list have been deleted, this object will be garbage collected.
If this object is managed by a controller, then an entry in this
list will point to this controller, with the controller field set
to true. There cannot be more than one managing controller.
items:
properties:
apiVersion:
description:API version of the referent.
type:string
blockOwnerDeletion:
description:If true, AND if the owner has the "foregroundDeletion"
finalizer, then the owner cannot be deleted from the key-value
store until this reference is removed. Defaults to false.
To set this field, a user needs "delete" permission of the
owner, otherwise 422 (Unprocessable Entity) will be returned.
type:boolean
controller:
description:If true, this reference points to the managing
controller.
type:boolean
kind:
description:'Kind of the referent. More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type:string
name:
description:'Name of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
uid:
description:'UID of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#uids'
type:string
required:
- apiVersion
- kind
- name
- uid
type:object
type:array
resourceVersion:
description:"An opaque value that represents the internal version
of this object that can be used by clients to determine when objects
have changed. May be used for optimistic concurrency, change detection,
and the watch operation on a resource or set of resources. Clients
must treat these values as opaque and passed unmodified back to
the server. They may only be valid for a particular resource or
set of resources. \n Populated by the system. Read-only. Value must
be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"
type:string
selfLink:
description:SelfLink is a URL representing this object. Populated
by the system. Read-only.
type:string
uid:
description:"UID is the unique in time and space value for this object.
It is typically generated by the server on successful creation of
a resource and is not allowed to change on PUT operations. \n Populated
by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
type:string
type:object
spec:
description:CollectorSpec defines the desired state of Collector
properties:
afterCollection:
items:
@@ -398,21 +42,27 @@ spec:
properties:
method:
type:string
redactUri:
type:string
uri:
type:string
required:
- uri
- method
- redactUri
- uri
type:object
uploadResultsTo:
properties:
method:
type:string
redactUri:
type:string
uri:
type:string
required:
- uri
- method
- redactUri
- uri
type:object
type:object
type:array
@@ -420,8 +70,18 @@ spec:
items:
properties:
clusterInfo:
properties:
collectorName:
type:string
exclude:
type:BoolString
type:object
clusterResources:
properties:
collectorName:
type:string
exclude:
type:BoolString
type:object
copy:
properties:
@@ -431,6 +91,10 @@ spec:
type:string
containerPath:
type:string
exclude:
type:BoolString
name:
type:string
namespace:
type:string
selector:
@@ -438,9 +102,22 @@ spec:
type:string
type:array
required:
- selector
- namespace
- containerPath
- namespace
- selector
type:object
data:
properties:
collectorName:
type:string
data:
type:string
exclude:
type:BoolString
name:
type:string
required:
- data
type:object
exec:
properties:
@@ -456,6 +133,10 @@ spec:
type:array
containerName:
type:string
exclude:
type:BoolString
name:
type:string
namespace:
type:string
selector:
@@ -465,13 +146,15 @@ spec:
timeout:
type:string
required:
- selector
- namespace
- selector
type:object
http:
properties:
collectorName:
type:string
exclude:
type:BoolString
get:
properties:
headers:
@@ -480,11 +163,20 @@ spec:
type:object
insecureSkipVerify:
type:boolean
timeout:
description:A Duration represents the elapsed time
between two instants as an int64 nanosecond count.
The representation limits the largest representable
duration to approximately 290 years.
format:int64
type:integer
url:
type:string
required:
- url
type:object
name:
type:string
post:
properties:
body:
@@ -495,6 +187,13 @@ spec:
type:object
insecureSkipVerify:
type:boolean
timeout:
description:A Duration represents the elapsed time
between two instants as an int64 nanosecond count.
The representation limits the largest representable
duration to approximately 290 years.
format:int64
type:integer
url:
type:string
required:
@@ -510,6 +209,13 @@ spec:
type:object
insecureSkipVerify:
type:boolean
timeout:
description:A Duration represents the elapsed time
between two instants as an int64 nanosecond count.
The representation limits the largest representable
duration to approximately 290 years.
format:int64
type:integer
url:
type:string
required:
@@ -520,6 +226,12 @@ spec:
properties:
collectorName:
type:string
containerNames:
items:
type:string
type:array
exclude:
type:BoolString
limits:
properties:
maxAge:
@@ -528,6 +240,8 @@ spec:
format:int64
type:integer
type:object
name:
type:string
namespace:
type:string
selector:
@@ -537,6 +251,39 @@ spec:
required:
- selector
type:object
mysql:
properties:
collectorName:
type:string
exclude:
type:BoolString
uri:
type:string
required:
- uri
type:object
postgres:
properties:
collectorName:
type:string
exclude:
type:BoolString
uri:
type:string
required:
- uri
type:object
redis:
properties:
collectorName:
type:string
exclude:
type:BoolString
uri:
type:string
required:
- uri
type:object
run:
properties:
args:
@@ -549,22 +296,39 @@ spec:
items:
type:string
type:array
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:
- namespace
- image
- namespace
type:object
secret:
properties:
collectorName:
type:string
exclude:
type:BoolString
includeValue:
type:boolean
key:
@@ -580,13 +344,8 @@ spec:
type:array
type:object
status:
description:CollectorStatus defines the observed state of Collector
description:PreflightJob is the Schema for the preflightjobs 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:PreflightJobSpec defines the desired state of PreflightJob
properties:
collectorImage:
type:string
collectorImagePullPolicy:
type:string
imagePullPolicy:
type:string
preflight:
properties:
name:
type:string
namespace:
type:string
required:
- name
type:object
preflightImage:
type:string
required:
- preflight
type:object
status:
description:PreflightJobStatus defines the observed state of PreflightJob
properties:
analyzersFailed:
items:
type:string
type:array
analyzersRunning:
items:
type:string
type:array
analyzersSuccessful:
items:
type:string
type:array
collectorsFailed:
items:
type:string
type:array
collectorsRunning:
items:
type:string
type:array
collectorsSuccessful:
items:
type:string
type:array
isAnalyzersComplete:
type:boolean
isServerReady:
type:boolean
serverPodName:
type:string
serverPodNamespace:
type:string
serverPodPort:
type:integer
required:
- analyzersFailed
- analyzersRunning
- analyzersSuccessful
- collectorsFailed
- collectorsRunning
- collectorsSuccessful
- isAnalyzersComplete
- isServerReady
- serverPodName
- serverPodNamespace
- serverPodPort
type:object
type:object
version:v1beta1
versions:
- name:v1beta1
schema:
openAPIV3Schema:
description:PreflightJob is the Schema for the preflightjobs 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/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/api-conventions.md#types-kinds'
type:string
metadata:
properties:
annotations:
additionalProperties:
type:string
description:'Annotations is an unstructured key value map stored
with a resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations'
type:object
clusterName:
description:The name of the cluster which the object belongs to.
This is used to distinguish resources with same name and namespace
in different clusters. This field is not set anywhere right now
and apiserver is going to ignore it if set in create or update request.
type:string
creationTimestamp:
description:"CreationTimestamp is a timestamp representing the server
time when this object was created. It is not guaranteed to be set
in happens-before order across separate operations. Clients may
not set this value. It is represented in RFC3339 form and is in
UTC. \n Populated by the system. Read-only. Null for lists. More
description:selfLink is a URL representing this object.
Populated by the system. Read-only.
type:string
type:object
reason:
description:A machine-readable description of why this operation
is in the "Failure" status. If this value is empty there
is no information available. A Reason clarifies an HTTP
status code but does not override it.
type:string
status:
description:'Status of the operation. One of:"Success"or
"Failure". More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status'
type:string
type:object
required:
- pending
type:object
labels:
additionalProperties:
type:string
description:'Map of string keys and values that can be used to organize
and categorize (scope and select) objects. May match selectors of
replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels'
type:object
managedFields:
description:"ManagedFields maps workflow-id and version to the set
of fields that are managed by that workflow. This is mostly for
internal housekeeping, and users typically shouldn't need to set
or understand this field. A workflow can be the user's name, a controller's
name, or the name of a specific apply path like \"ci-cd\". The set
of fields is always in the version that the workflow used when modifying
the object. \n This field is alpha and can be changed or removed
without notice."
items:
properties:
apiVersion:
description:APIVersion defines the version of this resource
that this field set applies to. The format is "group/version"
just like the top-level APIVersion field. It is necessary
to track the version of a field set because it cannot be automatically
converted.
type:string
fields:
additionalProperties:true
description:Fields identifies a set of fields.
type:object
manager:
description:Manager is an identifier of the workflow managing
these fields.
type:string
operation:
description:Operation is the type of operation which lead to
this ManagedFieldsEntry being created. The only valid values
for this field are 'Apply' and 'Update'.
type:string
time:
description:Time is timestamp of when these fields were set.
It should always be empty if Operation is 'Apply'
format:date-time
type:string
type:object
type:array
name:
description:'Name must be unique within a namespace. Is required
when creating resources, although some resources may allow a client
to request the generation of an appropriate name automatically.
Name is primarily intended for creation idempotence and configuration
definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
namespace:
description:"Namespace defines the space within each name must be
unique. An empty namespace is equivalent to the \"default\" namespace,
but \"default\" is the canonical representation. Not all objects
are required to be scoped to a namespace - the value of this field
for those objects will be empty. \n Must be a DNS_LABEL. Cannot
be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"
type:string
ownerReferences:
description:List of objects depended by this object. If ALL objects
in the list have been deleted, this object will be garbage collected.
If this object is managed by a controller, then an entry in this
list will point to this controller, with the controller field set
to true. There cannot be more than one managing controller.
items:
properties:
apiVersion:
description:API version of the referent.
type:string
blockOwnerDeletion:
description:If true, AND if the owner has the "foregroundDeletion"
finalizer, then the owner cannot be deleted from the key-value
store until this reference is removed. Defaults to false.
To set this field, a user needs "delete" permission of the
owner, otherwise 422 (Unprocessable Entity) will be returned.
type:boolean
controller:
description:If true, this reference points to the managing
controller.
type:boolean
kind:
description:'Kind of the referent. More info:https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type:string
name:
description:'Name of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#names'
type:string
uid:
description:'UID of the referent. More info:http://kubernetes.io/docs/user-guide/identifiers#uids'
type:string
required:
- apiVersion
- kind
- name
- uid
type:object
type:array
resourceVersion:
description:"An opaque value that represents the internal version
of this object that can be used by clients to determine when objects
have changed. May be used for optimistic concurrency, change detection,
and the watch operation on a resource or set of resources. Clients
must treat these values as opaque and passed unmodified back to
the server. They may only be valid for a particular resource or
set of resources. \n Populated by the system. Read-only. Value must
be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"
type:string
selfLink:
description:SelfLink is a URL representing this object. Populated
by the system. Read-only.
type:string
uid:
description:"UID is the unique in time and space value for this object.
It is typically generated by the server on successful creation of
a resource and is not allowed to change on PUT operations. \n Populated
by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"
description:Redactor is the Schema for the redaction 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:RedactorSpec defines the desired state of Redactor
properties:
redactors:
items:
properties:
fileSelector:
properties:
file:
type:string
files:
items:
type:string
type:array
type:object
name:
type:string
removals:
properties:
regex:
items:
properties:
redactor:
type:string
selector:
type:string
type:object
type:array
values:
items:
type:string
type:array
yamlPath:
items:
type:string
type:array
type:object
type:object
type:array
type:object
status:
description:RedactorStatus defines the observed state of Redactor
description:Redactor is the Schema for the redaction 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:RedactorSpec defines the desired state of Redactor
properties:
redactors:
items:
properties:
fileSelector:
properties:
file:
type:string
files:
items:
type:string
type:array
type:object
name:
type:string
removals:
properties:
regex:
items:
properties:
redactor:
type:string
selector:
type:string
type:object
type:array
values:
items:
type:string
type:array
yamlPath:
items:
type:string
type:array
type:object
type:object
type:array
type:object
status:
description:RedactorStatus defines the observed state of Redactor
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
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.