Skip to content

Commit 00d388c

Browse files
authored
Update README.md
1 parent bdb7920 commit 00d388c

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,63 @@
88

99
Filter Kubernetes resources by matching their names
1010

11-
# Compatibility
11+
## 🤔 Why we need this? what it is trying to resolve?
1212

13-
please refer to [Kubernetes version policy](https://kubernetes.io/docs/setup/release/version-skew-policy/#kubectl) and [CHANGELOG](CHANGELOG.md) for supported version matrix.
13+
Playing with Kubernetes in our daily job, we normally search pods by `pipe`, `grep`, `--label`, `--field-selector`, etc. while hunting abnormal pods, but typing such long commands is quite annoying. With plugin installed, it could be easily be done by `kubectl grep`.
1414

15-
# Why we need it?
15+
## 🔢 Prerequisites
1616

17-
playing with Kubernetes is my daily job, and I normally search pods by `pipe`,
18-
`grep`, `--label`, `--field-selector`, etc. while hunting abnormal pods, but
19-
typing such long commands is quite annoying.
17+
* An existing Kubernetes cluster.
18+
* Have [kubectl](https://kubernetes.io/docs/tasks/tools/) installed.
19+
* Have [krew](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) installed.
2020

21-
Before change, we usually filter pods by the following commands,
21+
## 🚀 Quick start
2222

23-
$ kubectl get pods -n star-lab | grep "flash"
23+
```bash
24+
# Have krew plugin installed
25+
kubectl krew install grep
26+
```
2427

25-
With this plugin installed, you can filter pod with `kubectl grep` easily
28+
```bash
29+
# Before change, we usually filter pods by the following commands,
30+
kubectl get pods -n star-lab | grep "flash"
31+
```
2632

27-
$ kubectl grep pods -n star-lab flash
33+
```bash
34+
# With this plugin installed, you can filter pod easily
35+
kubectl grep pods -n star-lab flash
36+
```
2837

29-
# Installation
38+
## :accessibility: FAQ
3039

31-
Installation via [krew](https://krew.sigs.k8s.io/docs/user-guide/setup/install/)
32-
33-
$ kubectl krew version # make sure you are running 0.4.4+
34-
$ kubectl krew install grep
35-
$ kubectl krew update
36-
$ kubectl krew upgrade grep
37-
38-
Manual Installation
39-
40-
$ curl -fsSL -O https://github.com/guessi/kubectl-grep/releases/latest/download/kubectl-grep-$(uname -s)-$(uname -m).tar.gz
41-
$ tar zxvf kubectl-grep-$(uname -s)-$(uname -m).tar.gz
42-
$ mv kubectl-grep /usr/local/bin
43-
44-
# How to get developer build?
45-
46-
$ go get -u github.com/guessi/kubectl-grep
47-
$ cd ${GOPATH}/src/github.com/guessi/kubectl-grep
48-
$ make all
49-
50-
# FAQ
51-
52-
How do I check the tool's version?
40+
How do I check the version installed?
5341

5442
* `kubectl grep version`
5543

56-
Can I use version X `kubectl` with version Y `kubectl-grep`?
44+
How do I know the version installed is compatible with my cluster version?
5745

58-
* Sure, no problem
46+
* Ideally, it should be compatible with [supported Kubernetes versions](https://kubernetes.io/releases/).
5947

6048
What kind of resource(s) `kubectl-grep` support?
6149

6250
* Please refer to [Resource Types](RESOURCE_TYPES.md)
6351

64-
# Reference
52+
## 👷 Install
53+
54+
### Recommended way
55+
56+
```bash
57+
kubectl krew install grep && kubectl krew update && kubectl krew upgrade grep
58+
```
59+
60+
### Manually setup (Developer build)
6561

66-
- [Kubectl Plugins](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/)
62+
```bash
63+
go get -u github.com/guessi/kubectl-grep
64+
cd ${GOPATH}/src/github.com/guessi/kubectl-grep
65+
make all
66+
```
6767

68-
# License
68+
## ⚖️ License
6969

7070
[Apache-2.0](LICENSE)

0 commit comments

Comments
 (0)