Plugin for kubectl that will help you to gather diagnostic info from running in Kubernetes dotnet applications. It can work with .NET Core 3.0+ applications and Kubernetes clusters with docker or containerd runtime.
At the moment the following diagnostic tools are supported:
dotnet-gcdumpdotnet-tracedotnet-dumpcreatedumpInspired by kubectl-flame.
You can install kubectl shovel via krew.
At first install krew if you don't have it yet following the guide - Installing.
Then you will be able to install shovel plugin:
kubectl krew install shovel
You can find latest release on repository release page.
Once you download compatible with your OS binary, move it to any directory specified in your $PATH.
Feel free to use it as a kubectl plugin or standalone executable (kubectl shovel/kubectl-shovel)
Get gcdump:
kubectl shovel gcdump --pod-name pod-name-74df554df7-qldq7 -o ./dump.gcdump
Or trace:
kubectl shovel trace --pod-name pod-name-74df554df7-qldq7 -o ./trace.nettrace
Or get full managed memory dump:
kubectl shovel dump --pod-name pod-name-74df554df7-qldq7 -o ./memory.dump --type Full
Or get full (managed and unmanaged) memory dump with createdump utility:
kubectl shovel coredump --pod-name pod-name-74df554df7-qldq7 -o ./coredump.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 or by using -h/--help flag.
dotnet-trace, dotnet-gcdump, dotnet-dump commands it runs job on pod's node and mounts /tmp folder with dotnet-diagnostic socket docker or containerd runtime folders (/var/lib/docker or /run/containerd)coredump command it runs privileged job (with SYS_PTRACE capability) on pod's node and mounts/tmp folder with dotnet-diagnostic socketdocker or containerd runtime folders (/var/lib/docker or /run/containerd)/proc folder mounted from host to find host process id for containerTo run all kinds of checks and generators please use:
make prepare
make test-unit
kind-clusters use containerd as container runtime, so functionality with docker-runtime won't be covered.
make test-integration-setup.
Also you can specify some version for cluster: kind create cluster --image=kindest/node:<version>, e.g v1.19.1 version.make test-integration. It will:make test
$ claude mcp add kubectl-shovel \
-- python -m otcore.mcp_server <graph>