

GitHub - fntlnz/kubectl-trace: Schedule bpftrace programs on your kubernetes clu...
source link: https://github.com/fntlnz/kubectl-trace
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
kubectl trace
kubectl trace
is a kubectl plugin that allows you to schedule the execution
of bpftrace programs in your Kubernetes cluster.
Installation
go get -u github.com/fntlnz/kubectl-trace/cmd/kubectl-trace
This will download and compile kubectl-trace
so that you can use it as a kubectl plugin with kubectl trace
Usage
You don't need to setup anything on your cluster before using it, please don't use it already on a production system, just because this isn't yet 100% ready.
Run a program from string literal:
kubectl trace run ip-180-12-0-152.ec2.internal -e "tracepoint:syscalls:sys_enter_* { @[probe] = count(); }"
Run a program from file:
kubectl trace run ip-180-12-0-152.ec2.internal -f read.bt
Need more programs? Look here
Some of them will not yet work because we don't attach with a TTY already, sorry for that but good news you can contribute it!
Status of the project
? All the MVP goals are done!
To consider this project (ready) the goals are:
- basic program run and attach
- list command to list running traces - command:
kubectl trace get
- delete running traces
- run without attach
- attach command to attach only - command:
kubectl trace attach <program>
- allow sending signals (probably requires a TTY), so that bpftrace commands can be notified to stop by the user before deletion and give back results
More things after the MVP:
The program is now limited to run programs only on your nodes but the idea is to have the ability to attach only to the user namespace of a pod, like:
kubectl trace run pod/<pod-name> -f read.bt
And even on a specific container
kubectl trace run pod/<pod-name> -c <container> f read.bt
So I would say, the next thing is to run bpftrace programs at a pod scope other than at node scope.
bpftrace work
I also plan to contribute some IO functions to bpftrace to send data to a backend database like InfluxDB instead of only stdout because that would enable having things like graphs showing
Contributing
Please just do it, this is MIT licensed so no reason not to!
Recommend
-
120
I got sick of typing the same kubectl commands over and over again so here is my simplified TUI wrapper, kk. Installation go get -u github.com/golang/dep/cmd/dep go get -d -u github.com/nii236...
-
61
The private bpftrace repository has just been made public, which is big news for DTrace fans. Created by Alastair Robertson , bpftrace is an open source high-level tracing front-...
-
91
README.md BPFtrace BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet Filter (eBPF) available in recent Linux kernels (4.x)....
-
44
README.md kubectl trace kubectl trace is a kubectl plugin that allows you to schedule the execution of
-
29
bpftrace is a new eBPF-based tracing tool that was first included in Fedora 28. It was developed by Brendan Gregg, Alastair Robertson and Matheus Marchini with the help o...
-
21
README.md Kubectl
-
51
本文翻译自 Brendan Gregg 的 Kernel analysis with bpftrace 在 2019 Linux Storage, Filesystem, and Memory-Management Summit(LSFMM) 峰会期间,我发表一篇关于 BPF observability 的演讲,其中包括我在 Netflix 生产服务器上...
-
34
README.md kubectl tree 🎄 A kubectl plugin to explore ownership relationships between Kubernetes objects through ownersReferences on them....
-
13
The bpftrace One-Liner Tutorial This teaches you bpftrace for Linux in 12 easy lessons, where each lesson is a one-liner you can try running. This series of one-liners introduces concepts which are summarized as bullet points. For a...
-
12
Kubectl Imperative == refers to cli commands Declarative == using YAML files --export --save-config --record kubectl replace With the apply command the configuration will be saved in an a...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK