kubectl trace是一个kubectl插件,能定期在Kubernetes集群中执行bpftrace程序

网友投稿 672 2022-10-30

kubectl trace是一个kubectl插件,能定期在Kubernetes集群中执行bpftrace程序

kubectl trace是一个kubectl插件,能定期在Kubernetes集群中执行bpftrace程序

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

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 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

And even on a specific container

kubectl trace run -c

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!

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Python Luigi 的简单使用示例
下一篇:hdu4499 搜索
相关文章

 发表评论

暂时没有评论,来抢沙发吧~