Skip to content

Commit

Permalink
use krew + misc cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Hamilton committed May 29, 2020
1 parent 2afd603 commit 0f81f69
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 45 deletions.
20 changes: 2 additions & 18 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ builds:
goarch: arm64
- goos: darwin
goarch: arm
- goos: windows
goarch: 386
- goos: windows
goarch: arm64
- goos: windows
Expand All @@ -52,21 +54,3 @@ changelog:
- '^test:'
- '^scripts:'
- '^proxies:'
# Goreleaser brew only provides binary packages, which is pretty
# useless on Mac as of notarization.
# We instead build from source, requiring the Go toolchain which
# is acceptable, as kubernetes-cli already requires this.
#brews:
# -
# # brew only supports one 32-bit ARM version
# goarm: 6
# github:
# owner: soluble-ai
# name: homebrew-kubetap
# commit_author:
# name: kubetap-bot
# email: [email protected]
# homepage: "https://github.com/soluble-ai/kubetap"
# description: "Proxy Kubernetes Services with ease"
# test: |
# system "#{bin}/kubectl-tap version"
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ The recommended installation method is to clone the repository and run:
make
```

Kubetap can also be installed from source using the following one-liner:

```sh
cd && GO111MODULE=on go get github.com/soluble-ai/kubetap/cmd/kubectl-tap@latest
```

### Homebrew

Soluble provides a [homebrew formula repository](https://github.com/soluble-ai/homebrew-kubetap).
Expand All @@ -70,6 +64,14 @@ brew install kubetap
Binary releases for Mac (non-notarized), Windows, and Linux of varying
architectures are available from the [Releases page](https://github.com/soluble-ai/kubetap/releases).

## With Krew

Kubetap can be installed with krew:

```sh
kubectl krew install tap
```

## Usage

Kubetap's binary is `kubectl-tap`, allowing it to be invoked as `kubectl tap`.
Expand Down
8 changes: 4 additions & 4 deletions cmd/kubectl-tap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ func main() {
onCmd.Flags().Bool("browser", false, "enable to open browser windows to service and proxy. Also enables --port-forward")
onCmd.Flags().String("protocol", "http", "specify a protocol. Supported protocols: [ http ]")

rootCmd.AddCommand(versionCmd)
rootCmd.AddCommand(onCmd)
rootCmd.AddCommand(offCmd)
rootCmd.AddCommand(listCmd)
rootCmd.AddCommand(versionCmd, onCmd, offCmd, listCmd)

if err := rootCmd.Execute(); err != nil {
exiter.Exit(1)
Expand Down Expand Up @@ -119,6 +116,9 @@ func NewRootCmd(e Exiter) *cobra.Command {
return &cobra.Command{
// HACK: there is a "bug" in cobra's handling of Use strings with spaces, so the space
// below in the Use field isn't a true space -- it's a unicode Em space.
// Also, if you can't see the space below prominently, you need to change your editor settings
// to reveal Unicode characters. Otherwise, you're likely to PR some malicious code with a unicode
// domain at some point.
Use: "kubectl tap",
Short: "kubetap",
Example: ` Create a tap for a new Service:
Expand Down
10 changes: 9 additions & 1 deletion docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Kubetap can also be installed from source using the following one-liner:
cd && GO111MODULE=on go get github.com/soluble-ai/kubetap/cmd/kubectl-tap@latest
```

## Brew
## Homebrew

Soluble provides a [homebrew formula repository](https://github.com/soluble-ai/homebrew-kubetap)
to use brew to build from source.
Expand All @@ -30,3 +30,11 @@ brew install kubetap
Binary releases for Mac, Windows, and Linux of varying architectures are
available from the [Releases page](https://github.com/soluble-ai/kubetap/releases).

## With Krew

Kubetap can be installed with [krew](https://github.com/kubernetes-sigs/krew):

```sh
kubectl krew install tap
```

16 changes: 0 additions & 16 deletions docs/kubetap_development/caveats.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,3 @@ cannot target ports 7777 or 2244.
If you use PSPs, the target Pod will need access to `ConfigMap`s and `EmptyDir`s.

If the target Pod does not have access to these resources, kubetap will fail.

## Kubetap Development

### Mac Notarization

Most developers use Macs (sorry, it's true), and having un-notarized binaries is
a problem. Until that's resolved, building from source is the only recommended installation
mechanism for Mac operators.

### Krew Plugin

From my light browsing of the [krew index](https://github.com/kubernetes-sigs/krew-index/tree/master/plugins)
it seems that all of the plugins are binary only. This is very unfortunate.

Due to the Mac notarization changes described above, kubetap will not have a
krew plugin.

0 comments on commit 0f81f69

Please sign in to comment.