A kubectl plugin that allows you to profile production applications with low-overhead by generating FlameGraphs
Running kubectlf-flame
does not require any modification to existing pods.
- Currently, only Java applications are supported. (Golang support coming soon!)
- Kubernetes cluster that use Docker as the container runtime (tested on GKE, EKS and AKS)
In order to profile pod mypod
for 1 minute and save the flamegraph as /tmp/flamegraph.svg
run:
kubectl flame mypod -t 1m -f /tmp/flamegraph.svg
Profiling alpine based containers require using --alpine
flag:
kubectl flame mypod -t 1m -f /tmp/flamegraph.svg --alpine
Pods that contains more than one container require specifying the target container as an argument:
kubectl flame mypod -t 1m -f /tmp/flamegraph.svg mycontainer
You can install kubectl flame
using the Krew, the package manager for kubectl plugins.
Once you have Krew installed just run:
kubectl krew install flame
See the release page for the full list of pre-built assets.
kubectl-flame
launch a Kubernetes Job on the same node as the target pod.
Under the hood kubectl-flame
use async-profiler in order to generate flame graphs for Java applications.
Interaction with the target JVM is done via a shared /tmp
folder.
Other languages support (such as the upcoming Golang support) will be based on ebpf profiling.
Please refer to the contributing.md file for information about how to get involved. We welcome issues, questions, and pull requests.
- Eden Federman: efederman@verizonmedia.com
This project is licensed under the terms of the Apache 2.0 open source license. Please refer to LICENSE for the full terms.