GithubHelp home page GithubHelp logo

isabella232 / kubectl-curl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from segmentio/kubectl-curl

0.0 0.0 0.0 77 KB

Kubectl plugin to run curl commands against kubernetes pods

License: MIT License

Go 100.00%

kubectl-curl's Introduction

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

kubectl curl [options] URL [container]
  • In the URL, the host part must be the name of the pod to send the request to.
  • If no port number is specified, the request will be sent to a http port.
  • If there are multiple containers with a 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://{pod}/debug/pprof/profile?debug=1&seconds=10" > ./profile
$ go tool pprof -http :6060 ./profile

Retrieving prometheus metrics

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

kubectl-curl's People

Contributors

achille-roussel avatar bartleyg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.