Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cbuto/kubectl-pprof
kubectl plugin to collect pprof profiles from pods
https://github.com/cbuto/kubectl-pprof
kubectl-plugin pprof
Last synced: 2 months ago
JSON representation
kubectl plugin to collect pprof profiles from pods
- Host: GitHub
- URL: https://github.com/cbuto/kubectl-pprof
- Owner: cbuto
- License: apache-2.0
- Created: 2023-07-30T17:22:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-31T02:17:56.000Z (over 1 year ago)
- Last Synced: 2024-06-21T08:27:06.287Z (7 months ago)
- Topics: kubectl-plugin, pprof
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kubectl pprof plugin
A simple kubectl plugin to collect Go pprof profiles from pods that
expose the ["net/http/pprof"](https://pkg.go.dev/net/http/pprof) endpoints on a local port.The plugin will port-forward to the specified pod and write the pprof profile to the filesystem
to be analyze with `go tool pprof`.## Installing
1. Download the binary from the GH release
2. Move the `kubectl-pprof` binary to anywhere in your `$PATH`
3. Run `kubectl pprof -h` to validate the plugin is working## Example usage
### Collecting a CPU profile
```bash
kubectl pprof --port 8080 -n --profile cpu
```### Collecting a heap profile for 30 seconds
```bash
kubectl pprof --port 8080 -n --profile heap --seconds 30 --output /tmp/
```### Pass a profile directly to `go tool pprof` (suppress output with `-q`)
```bash
kubectl pprof --port 8080 -n --profile cpu -q | xargs go tool pprof -http=:8080
```