-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: coredump implementation (#22)
* feat(cli): add command implementation draft for createdump tool Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(cli): tune some docs Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(cli): refactor examples for cli commands Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(*): add additional path to $PATH variable for dumper Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(*): add flags & args formatting for createdump Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(tests): implement unit test for createdump Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(tests): implement integration test for createdump Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(dumper): add command for createdump Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(dumper): add terminationmessagepolicy for worker pod Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(flags): remove unused method Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(*): rename method to better describe intention Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(*): remove Formatter interface & update usages for more clear args fomatting Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(tests): fix broken integration tests Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(*): add command to makefile to build all components Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(flags): split interfaces & better naming Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(flags): make implementation private Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(flags): rename method & drop aux interface Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(flags): remove code duplication for createdump Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(flags): replace action with formatargstype enum Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(flags): split file Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(flags): use different flags for tool and binary in createdump Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(tests): update unit tests for args formatting Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(flags): add IsPrivileged option & override for createdump command Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(cli): add privileged options to job spec Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(tests): implement unit tests on full job spec Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(dumper): add privileged options support Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(*): rename create_dump -> core_dump & corresponding tool Signed-off-by: ArtemTrofimushkin <[email protected]> * feat(flag): add coredump type option Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(tests): tidy tests & add coredump type tests Signed-off-by: ArtemTrofimushkin <[email protected]> * chore(tests): add custom type for coredump Signed-off-by: ArtemTrofimushkin <[email protected]> * docs(*): generate docs Signed-off-by: ArtemTrofimushkin <[email protected]> * docs(*): update README Signed-off-by: ArtemTrofimushkin <[email protected]> * fix: bump dumper image version Signed-off-by: ArtemTrofimushkin <[email protected]> * doc(*): small fixes in readme Signed-off-by: ArtemTrofimushkin <[email protected]>
- Loading branch information
1 parent
fbca829
commit 4c04363
Showing
38 changed files
with
931 additions
and
629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
## kubectl-shovel coredump | ||
|
||
Get full process dump results | ||
|
||
### Synopsis | ||
|
||
This subcommand will run coredump tool for running in k8s application. | ||
Result will be saved locally (or on host) so you'll be able to analyze it with appropriate instruments. | ||
Tool specific additional arguments are also supported. | ||
You can find more info about this tool by the following links: | ||
|
||
* https://docs.microsoft.com/en-us/dotnet/core/diagnostics/debug-linux-dumps#core-dumps-with-createdump | ||
* https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/botr/xplat-minidump-generation.md | ||
|
||
``` | ||
kubectl-shovel coredump [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
The only required flag is `--pod-name`. So you can use it like this: | ||
kubectl shovel coredump --pod-name my-app-65c4fc589c-gznql | ||
Use `-o`/`--output` to define name of dump file: | ||
kubectl shovel coredump --pod-name my-app-65c4fc589c-gznql -o ./myapp.coredump | ||
Also use `-n`/`--namespace` if your pod is not in current context's namespace: | ||
kubectl shovel coredump --pod-name my-app-65c4fc589c-gznql -n default | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | ||
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | ||
--as-uid string UID to impersonate for the operation. | ||
--cache-dir string Default cache directory (default "/home/user/.kube/cache") | ||
--certificate-authority string Path to a cert file for the certificate authority | ||
--client-certificate string Path to a client certificate file for TLS | ||
--client-key string Path to a client key file for TLS | ||
--cluster string The name of the kubeconfig cluster to use | ||
-c, --container string Target container in pod. Required if pod run multiple containers | ||
--context string The name of the kubeconfig context to use | ||
-h, --help help for coredump | ||
--image string Image of dumper to use for job (default "dodopizza/kubectl-shovel-dumper:undefined") | ||
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | ||
--kubeconfig string Path to the kubeconfig file to use for CLI requests. | ||
-n, --namespace string If present, the namespace scope for this CLI request | ||
-o, --output string Output file (default "./output.coredump") | ||
--output-host-path string Host folder, where will be stored artifact (default "/tmp/kubectl-shovel") | ||
--pod-name string Target pod | ||
-p, --process-id int The process ID to collect the trace from (default 1) | ||
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0") | ||
-s, --server string The address and port of the Kubernetes API server | ||
-t, --store-output-on-host Store output on node instead of downloading it locally | ||
--tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | ||
--token string Bearer token for authentication to the API server | ||
--type type The kinds of information that are collected from process. Supported types: | ||
Full, Heap, Mini, Triage | ||
Full - A full core dump with all process memory | ||
Heap - A process dump with heap | ||
Mini - A normal minidump with some process information | ||
Triage - A small dump containing minimal information (default Full) | ||
--user string The name of the kubeconfig user to use | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kubectl-shovel](kubectl-shovel.md) - Get diagnostics from running in k8s dotnet application | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.