Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 347a93d

Browse files
authored
Enhance README with pod and resource reference details (#18)
Clarify URL host part options for kubectl curl command. Follow-up to #16 which failed to update the docs.
1 parent c438fa7 commit 347a93d

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

‎README.md‎

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ The following compatible plugins are available:
3333
kubectl curl [options] URL [container]
3434
```
3535

36-
* In the URL, the host part must be the name of the pod to send the request to.
37-
* If no port number is specified, the request will be sent to a `http` port.
38-
* If there are multiple containers with a `http` port, the name of the container
36+
* In the `URL`, the host part can be:
37+
* **podName**: pod to send the request to
38+
* a resource reference, such as **deployment/deploymentName**. The request is sent to a random pod from this resource.
39+
* NOTE: supported resources: **deployment**, **statefulset**, **daemonset**
40+
* NOTE: supported abbreviations: **deploy**, **sts**, **ds**
41+
* If no port number is specified, the request will be sent to an `http` port.
42+
* If there are multiple containers with an `http` port, the name of the container
3943
to send to the request to must be specified after the URL.
4044

4145
## Examples
@@ -45,15 +49,32 @@ This section records common use cases for this kubectl plugin.
4549
### Collecting profiles of Go programs
4650

4751
```
48-
$ kubectl curl "http://{pod}/debug/pprof/profile?debug=1&seconds=10" > ./profile
52+
$ kubectl curl "http://{podname}/debug/pprof/profile?debug=1&seconds=10" > ./profile
4953
$ go tool pprof -http :6060 ./profile
5054
```
5155

5256
* Full documentation: [net/http/pprof](https://pkg.go.dev/net/http/pprof)
5357

5458
### Retrieving prometheus metrics
5559

60+
All of these variants work:
61+
5662
```
57-
$ kubectl curl http://{pod}/metrics
63+
$ kubectl curl http://{podname}/metrics
64+
...
65+
66+
$ kubectl curl http://daemonset/{daemonsetname}/metrics
67+
...
68+
69+
$ kubectl curl http://ds/{daemonsetname}/metrics
70+
...
71+
72+
$ kubectl curl {podname}/metrics
73+
...
74+
75+
$ kubectl curl daemonset/{daemonsetname}/metrics
76+
...
77+
78+
$ kubectl curl ds/{daemonsetname}/metrics
5879
...
5980
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /