dodopizza / kubectl-shovel

kubectl plugin for gathering diagnostics from running in k8s dotnet applications
Apache License 2.0
46 stars 5 forks source link
infra-services kubectl-plugins kubernetes toil-elimination utility

kubectl shovel

Testing and publishing Go Report Card FOSSA Status GitHub Release

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:

Inspired by kubectl-flame.

Installation

Krew

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

Precompiled binaries

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.

Usage

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.

How it works

Development

To run all kinds of checks and generators please use:

make prepare

Prerequisites

Testing

Unit tests

make test-unit

Integration tests

kind-clusters use containerd as container runtime, so functionality with docker-runtime won't be covered.

All in one

make test