Skip to content

Commit

Permalink
Feature: update tooling (#13)
Browse files Browse the repository at this point in the history
* chore(*): update go.mod & tidy

Signed-off-by: ArtemTrofimushkin <[email protected]>

* chore(CI): bump go version

Signed-off-by: ArtemTrofimushkin <[email protected]>

* chore(readme): update readme

Signed-off-by: ArtemTrofimushkin <[email protected]>

* chore(dumper): bump runtime version

Signed-off-by: ArtemTrofimushkin <[email protected]>

* chore(*): update CODEOWNERS

Signed-off-by: ArtemTrofimushkin <[email protected]>

* chore(*): bump packages

Signed-off-by: ArtemTrofimushkin <[email protected]>

* chore(doc): update autogenerated docs

Signed-off-by: ArtemTrofimushkin <[email protected]>
  • Loading branch information
ArtemTrofimushkin authored Feb 17, 2022
1 parent c2888a2 commit 7709b24
Show file tree
Hide file tree
Showing 15 changed files with 676 additions and 127 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @StupidScience
* @ArtemTrofimushkin
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- "*"

env:
GOLANG_VERSION: "1.16"
GOLANG_VERSION: "^1.17.6"

jobs:
doc:
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ At the moment the following diagnostic tools are supported:

* `dotnet-gcdump`
* `dotnet-trace`
* `dotnet-dump`

Inspired by [`kubectl-flame`](https://github.com/VerizonMedia/kubectl-flame).

Expand Down Expand Up @@ -48,6 +49,12 @@ Or trace:
kubectl shovel trace --pod-name pod-name-74df554df7-qldq7 -o ./trace.nettrace
```

Or get full memory dump:

```shell
kubectl shovel dump --pod-name pod-name-74df554df7-qldq7 -o ./memory.dump --type full
```

Most of dotnet tools flags supported as well to use, e.g `--duration` and `--format` for `trace`.
You can find more info and examples in [cli documentation](./cli/docs/kubectl-shovel.md) or by using `-h/--help` flag.

Expand Down
1 change: 1 addition & 0 deletions cli/docs/kubectl-shovel.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Get diagnostics from running in k8s dotnet application

### SEE ALSO

* [kubectl-shovel completion](kubectl-shovel_completion.md) - generate the autocompletion script for the specified shell
* [kubectl-shovel dump](kubectl-shovel_dump.md) - Get dotnet-dump results
* [kubectl-shovel gcdump](kubectl-shovel_gcdump.md) - Get dotnet-gcdump results
* [kubectl-shovel trace](kubectl-shovel_trace.md) - Get dotnet-trace results
Expand Down
25 changes: 25 additions & 0 deletions cli/docs/kubectl-shovel_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## kubectl-shovel completion

generate the autocompletion script for the specified shell

### Synopsis


Generate the autocompletion script for kubectl-shovel for the specified shell.
See each sub-command's help for details on how to use the generated script.


### Options

```
-h, --help help for completion
```

### SEE ALSO

* [kubectl-shovel](kubectl-shovel.md) - Get diagnostics from running in k8s dotnet application
* [kubectl-shovel completion bash](kubectl-shovel_completion_bash.md) - generate the autocompletion script for bash
* [kubectl-shovel completion fish](kubectl-shovel_completion_fish.md) - generate the autocompletion script for fish
* [kubectl-shovel completion powershell](kubectl-shovel_completion_powershell.md) - generate the autocompletion script for powershell
* [kubectl-shovel completion zsh](kubectl-shovel_completion_zsh.md) - generate the autocompletion script for zsh

39 changes: 39 additions & 0 deletions cli/docs/kubectl-shovel_completion_bash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## kubectl-shovel completion bash

generate the autocompletion script for bash

### Synopsis


Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package.
If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:
$ source <(kubectl-shovel completion bash)

To load completions for every new session, execute once:
Linux:
$ kubectl-shovel completion bash > /etc/bash_completion.d/kubectl-shovel
MacOS:
$ kubectl-shovel completion bash > /usr/local/etc/bash_completion.d/kubectl-shovel

You will need to start a new shell for this setup to take effect.


```
kubectl-shovel completion bash
```

### Options

```
-h, --help help for bash
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kubectl-shovel completion](kubectl-shovel_completion.md) - generate the autocompletion script for the specified shell

33 changes: 33 additions & 0 deletions cli/docs/kubectl-shovel_completion_fish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## kubectl-shovel completion fish

generate the autocompletion script for fish

### Synopsis


Generate the autocompletion script for the fish shell.

To load completions in your current shell session:
$ kubectl-shovel completion fish | source

To load completions for every new session, execute once:
$ kubectl-shovel completion fish > ~/.config/fish/completions/kubectl-shovel.fish

You will need to start a new shell for this setup to take effect.


```
kubectl-shovel completion fish [flags]
```

### Options

```
-h, --help help for fish
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kubectl-shovel completion](kubectl-shovel_completion.md) - generate the autocompletion script for the specified shell

31 changes: 31 additions & 0 deletions cli/docs/kubectl-shovel_completion_powershell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## kubectl-shovel completion powershell

generate the autocompletion script for powershell

### Synopsis


Generate the autocompletion script for powershell.

To load completions in your current shell session:
PS C:\> kubectl-shovel completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command
to your powershell profile.


```
kubectl-shovel completion powershell [flags]
```

### Options

```
-h, --help help for powershell
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kubectl-shovel completion](kubectl-shovel_completion.md) - generate the autocompletion script for the specified shell

38 changes: 38 additions & 0 deletions cli/docs/kubectl-shovel_completion_zsh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## kubectl-shovel completion zsh

generate the autocompletion script for zsh

### Synopsis


Generate the autocompletion script for the zsh shell.

If shell completion is not already enabled in your environment you will need
to enable it. You can execute the following once:

$ echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions for every new session, execute once:
# Linux:
$ kubectl-shovel completion zsh > "${fpath[1]}/_kubectl-shovel"
# macOS:
$ kubectl-shovel completion zsh > /usr/local/share/zsh/site-functions/_kubectl-shovel

You will need to start a new shell for this setup to take effect.


```
kubectl-shovel completion zsh [flags]
```

### Options

```
-h, --help help for zsh
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kubectl-shovel completion](kubectl-shovel_completion.md) - generate the autocompletion script for the specified shell

3 changes: 2 additions & 1 deletion cli/docs/kubectl-shovel_dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ Also use `-n`/`--namespace` if your pod is not in current context's namespace:
### Options

```
--as string Username to impersonate for the operation
--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
Expand Down
3 changes: 2 additions & 1 deletion cli/docs/kubectl-shovel_gcdump.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ Also use `-n`/`--namespace` if your pod is not in current context's namespace:
### Options

```
--as string Username to impersonate for the operation
--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
Expand Down
3 changes: 2 additions & 1 deletion cli/docs/kubectl-shovel_trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ Or convert any other format to speedscope format with:
### Options

```
--as string Username to impersonate for the operation
--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.
--buffersize int Sets the size of the in-memory circular buffer, in megabytes (default 256)
--cache-dir string Default cache directory (default "/home/user/.kube/cache")
--certificate-authority string Path to a cert file for the certificate authority
Expand Down
4 changes: 2 additions & 2 deletions dumper/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUNTIME_VERSION=3.1.20
ARG RUNTIME_VERSION=3.1.22

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic as tools-install

Expand All @@ -8,7 +8,7 @@ RUN dotnet tool install -g dotnet-gcdump && \

FROM mcr.microsoft.com/dotnet/core/runtime:${RUNTIME_VERSION}-bionic

ARG RUNTIME_VERSION=3.1.20
ARG RUNTIME_VERSION=3.1.22
ARG DOTNET_TOOLS_PATH="/root/.dotnet/tools"
ARG DOTNET_INTERNAL_TOOLS_PATH="/usr/share/dotnet/shared/Microsoft.NETCore.App/${RUNTIME_VERSION}"
ENV PATH="${PATH}:${DOTNET_TOOLS_PATH}:${DOTNET_INTERNAL_TOOLS_PATH}"
Expand Down
92 changes: 83 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,91 @@
module github.com/dodopizza/kubectl-shovel

go 1.16
go 1.17

require (
github.com/google/uuid v1.2.0
github.com/googleapis/gnostic v0.5.1 // indirect
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.1.1
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1
k8s.io/api v0.20.5
k8s.io/apimachinery v0.20.5
k8s.io/cli-runtime v0.20.5
k8s.io/client-go v0.20.5
k8s.io/kubectl v0.20.5
github.com/stretchr/testify v1.7.0
k8s.io/api v0.23.3
k8s.io/apimachinery v0.23.3
k8s.io/cli-runtime v0.23.3
k8s.io/client-go v0.23.3
k8s.io/kubectl v0.23.3
)

require (
cloud.google.com/go v0.81.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fvbommel/sortorder v1.0.1 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/imdario/mergo v0.3.5 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday v1.5.2 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/component-base v0.23.3 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/kustomize/api v0.10.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
Loading

0 comments on commit 7709b24

Please sign in to comment.