Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyisan committed Sep 16, 2022
1 parent 7aa5068 commit 3399e93
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ VERSION=$(shell git rev-parse --short HEAD)
BUILD=$(shell date +%FT%T%z)

build-linux:
@GOARCH=amd64 CGO_ENABLED=1 GOOS=linux go build -ldflags "-s -w -X main.Version=${VERSION} -X main.Build=${BUILD}" -o bin/kube-resource_linux
@GOARCH=amd64 CGO_ENABLED=1 GOOS=linux go build -ldflags "-s -w -X main.Version=${VERSION} -X main.Build=${BUILD}" -o bin/linux/kube-resource

build-osx:
@GOARCH=amd64 CGO_ENABLED=1 GOOS=darwin go build -ldflags "-s -w -X main.Version=${VERSION} -X main.Build=${BUILD}" -o bin/kube-resource_darwin
@GOARCH=amd64 CGO_ENABLED=1 GOOS=darwin go build -ldflags "-s -w -X main.Version=${VERSION} -X main.Build=${BUILD}" -o bin/darwin/kube-resource

build-windows:
@GOARCH=amd64 CGO_ENABLED=1 GOOS=windows go build -ldflags "-s -w -X main.Version=${VERSION} -X main.Build=${BUILD}" -o bin/kube-resource_windows
@GOARCH=amd64 CGO_ENABLED=1 GOOS=windows go build -ldflags "-s -w -X main.Version=${VERSION} -X main.Build=${BUILD}" -o bin/win/kube-resource

clean:
@if [ -f bin/kube-resource_linux ] ; then rm bin/kube-resource_linux ; fi
@if [ -f bin/kube-resource_darwin ] ; then rm bin/kube-resource_darwin ; fi
@if [ -f bin/kube-resource_windows ] ; then rm bin/kube-resource_windows ; fi
@if [ -f bin/linux/kube-resource ] ; then rm bin/linux/ ; fi
@if [ -f bin/darwin/kube-resource ] ; then rm bin/darwin/ ; fi
@if [ -f bin/win/kube-resource ] ; then rm bin/win/ ; fi
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# kubernetes-resource-list

This app can show a list of Kubernetes API resources and subresources

## Why

When I was writing my RBAC configuration, I couldn't find resources, especially subresources, and the official kubernetes documentation doesn't list them anywhere.

## How To Use
```shell
$ ./kube-resource --help
Usage of ./kube-resource:
-c, --kubeconfig string (optional) absolute path to the kubeconfig file
-p, --prefer (optional) only display the supported resources with the version preferred by the server.
-s, --search string (optional) only display the supported resources for a group and version.
-v, --version show app version
```

### Example
```shell
$ ./kube-resource
APIGROUPS GROUPVERSION NAME VERBS
core v1 bindings [create]
core v1 componentstatuses [get list]
core v1 configmaps [create delete deletecollection get list patch update watch]
core v1 endpoints [create delete deletecollection get list patch update watch]
core v1 events [create delete deletecollection get list patch update watch]
core v1 limitranges [create delete deletec

...
..
.
```

0 comments on commit 3399e93

Please sign in to comment.