百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
K

kubectl-curl

> 云原生
开源

Kubectl 插件,用于执行针对 Kubernetes pod 的 curl 命令

188 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Kubectl 插件,用于执行针对 Kubernetes pod 的 curl 命令

kubectl-curl

Kubectl plugin to run curl commands against kubernetes pods

Motivation

Sending http requests to kubernetes pods is unnecessarily complicated, this plugin makes it easy.

The plugin creates a port forwarding from the local network to the kubernetes pod that was selected to receive the request, then instantiate a curl command by rewriting the URL to connect to the forwarded local port, and passing all curl options that were given on the command line.

Installation

If $GOPATH/bin is in the PATH, the plugin can be installed with:

$ go install github.com/segmentio/kubectl-curl@latest

If it was installed properly, it will be visibile when listing kubectl plugins:

$ kubectl plugin list
The following compatible plugins are available:

/.../kubectl-curl

Usage

bash
kubectl curl [options] URL [container]
  • In the URL, the host part can be:
    • podName: pod to send the request to
    • a resource reference, such as deployment/deploymentName. The request is sent to a random pod from this resource.
      • NOTE: supported resources: deployment, statefulset, daemonset
      • NOTE: supported abbreviations: deploy, sts, ds
  • If no port number is specified, the request will be sent to an http port.
  • If there are multiple containers with an http port, the name of the container to send to the request to must be specified after the URL.

Examples

This section records common use cases for this kubectl plugin.

Collecting profiles of Go programs

$ kubectl curl "http://{podname}/debug/pprof/profile?debug=1&seconds=10" > ./profile
$ go tool pprof -http :6060 ./profile
  • Full documentation: net/http/pprof

Retrieving prometheus metrics

All of these variants work:

$ kubectl curl http://{podname}/metrics
...

$ kubectl curl http://daemonset/{daemonsetname}/metrics
...

$ kubectl curl http://ds/{daemonsetname}/metrics
...

$ kubectl curl {podname}/metrics
...

$ kubectl curl daemonset/{daemonsetname}/metrics
...

$ kubectl curl ds/{daemonsetname}/metrics
...

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gocurlgolangkubectlkubectl-command

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类云原生
定价开源

> 相关工具

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,