kurl

command module
v0.0.0-...-52df5b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

README

kurl: curl for Kubernetes

Build Status Go Report Card

kurl makes it easy to quickly issue a GET request to a pod running on your Kubernetes cluster. It also supports a more advanced "proxy mode", which allows you to talk to pods using the tool of your choice.

Usage

[root@localhost ~]# ./kurl -h
kurl: curl for Kubernetes

Usage: kurl POD_NAME
      --proxy[=false]: start in proxy mode
      --proxy-port="9090": set the port when running in proxy mode
  -s, --server="http://127.0.0.1:8080": address of the K8s API Server

Example

Assuming you have an nginx pod running on your Kubernetes cluster:

[root@localhost ~]# kubectl get pods
NAME                     READY     STATUS    RESTARTS   AGE
nginx-3137573019-jqvxa   1/1       Running   0          42m
Basic (GET request)
[root@localhost ~]# kurl nginx
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
Advanced (Proxy mode)
[root@localhost ~] kurl --proxy &
[1] 24271
Starting proxy on port 9090

[root@localhost ~] export http_proxy=localhost:9090
[root@localhost ~]# curl --head nginx
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 612
Content-Type: text/html
Date: Fri, 12 Aug 2016 02:37:13 GMT
Etag: "574da256-264"
Last-Modified: Tue, 31 May 2016 14:40:22 GMT
Server: nginx/1.11.1
Build binary (using docker)
docker build -t kurl-release .
docker run kurl-release cat kurl > kurl #(unix binary)
docker run kurl-release cat kurl.exe > kurl.exe #(windows binary)

Documentation

Overview

Copyright 2016 Alexander Brand Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL